Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Space Context Wallet API
version: v1
servers:
- url: https://api.spacecontext.app/v1
tags:
- name: Wallet
paths:
/wallet:
get:
operationId: getWallet
summary: What this key has to spend
description: 'For agents: the balance, the free scans left, the price of a scan and whether a card is on file (`card_on_file`: live scans need one). A test key reads a fixed test-mode wallet instead (balance 0, no free scan, `card_on_file` false, automatic recharge off, the live price): test scans cost nothing and need no card. Needs the `scans:read` scope.'
security:
- apiKey: []
responses:
'200':
description: Wallet
headers:
Cache-Control:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/Wallet'
'401':
$ref: '#/components/responses/ErrorResponse'
'403':
$ref: '#/components/responses/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
tags:
- Wallet
components:
schemas:
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
- request_id
properties:
code:
type: string
message:
type: string
request_id:
type: string
retry_after:
type: integer
description: 'On a 429: seconds to wait, as in `Retry-After`.'
daily_limit:
type: integer
description: 'On a 429 for a daily allowance: the allowance (it resets at midnight UTC).'
max_streams:
type: integer
description: 'On a 429 from `GET /scans/{id}/events`: the streams an account may hold open at once.'
max_open_scans:
type: integer
description: 'On a 429 from `POST /spaces/{id}/scans`: the scans an account may hold created and not started.'
additionalProperties: true
Wallet:
type: object
required:
- object
- currency
- balance_cents
- free_scans_remaining
- scan_price_cents
- card_on_file
- auto_recharge
properties:
object:
type: string
const: wallet
currency:
type: string
const: usd
balance_cents:
type: integer
free_scans_remaining:
type: integer
minimum: 0
scan_price_cents:
type: integer
minimum: 1
card_on_file:
type: boolean
description: 'A real card stands behind the account: a card saved in the console, a paid top-up, or a settled x402 payment on mainnet. Starting a live scan, and creating a live key that can scan, need it: without it they answer 402 `PAYMENT_METHOD_REQUIRED`. Adding a card charges nothing.'
tax_added:
type: boolean
description: Whether tax is added on top of top-ups and automatic recharges where it applies (such as VAT), from the billing address and tax ID, and shown on the payment page and the invoice. A business with a valid VAT number in another EU country is invoiced under the reverse charge. The balance always receives the amount before tax.
auto_recharge:
type: object
required:
- enabled
properties:
enabled:
type: boolean
threshold_cents:
type:
- integer
- 'null'
amount_cents:
type:
- integer
- 'null'
payment_method_saved:
type: boolean
last_error:
type:
- string
- 'null'
terms_accepted:
type:
- object
- 'null'
required:
- version
- accepted_at
description: 'Console only (absent from `GET /wallet`): the first time this account accepted the current version of the billing terms, with the box of a payment or card page; null if never, or only an older version. The box is still ticked on every page (`accept_terms`), and the first acceptance is kept on later payments for a dispute.'
properties:
version:
type: string
accepted_at:
type: string
format: date-time
responses:
ErrorResponse:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
RateLimited:
description: Too many requests. Retry after the number of seconds in `Retry-After`.
headers:
Retry-After:
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
securitySchemes:
apiKey:
type: http
scheme: bearer
bearerFormat: sc_live or sc_test