API Reference v1
Get API Key API Key

POST /v1/cell-token

Exchange an API Key for a restricted Cell token

API Keys only; MCP OAuth is not accepted. Requires orders:read. Returns only orders:read/buy/sell/cancel granted by the parent Key. Each token binds one enabled chain and Cell, lasts at most 60 seconds and cannot outlive the Key. Revocation, rotation or narrowing prevents new grants; existing tokens expire within 60 seconds. Already accepted orders remain active. Cache tokens in memory and refresh before expiry. Cell enforces the signed IP allowlist. Direct status and SSE read all orders belonging to this account on that Cell; cancellation may affect existing account orders.

Required scope: orders:read

Request body application/json

FieldTypeRequiredDescription
chainenum ("solana" | "bsc" | "robinhood")✓Chain whose enabled Cell will receive the token. Each chain requires a separate token.

Responses

200 — Restricted token; Cache-Control: no-store.

FieldTypeRequiredConstraintsDescription
dataobject✓Response payload.
data.tokenstring✓Short-lived restricted bearer JWT. Send to the returned gateway in Authorization, never a URL.
data.expires_atstring✓UTC expiration, at most 60 seconds after issue and no later than the API Key expiry. Refresh before expiry.
data.cell_idstring✓pattern: ^[a-z0-9-]{1,32}$The single Cell audience bound into this token.
data.gateway_urlstring✓Configured HTTPS gateway for direct order operations.
data.scopesarray<enum ("orders:read" | "orders:buy" | "orders:sell" | "orders:cancel")>✓Order grants inherited from the API Key. Read and cancel apply to all owned account orders on this Cell.
metaobject✓Request id, plus paging fields when this operation is a list.
meta.request_idstring✓Id of this request. Also sent as the X-Request-Id response header.

401 — unauthorized (missing/invalid/revoked/expired Bearer token)

FieldTypeRequiredDescription
errorobject✓Why the request failed.
error.codestring✓Stable machine-readable error code.
error.messagestring✓Human-readable explanation of the error.
error.totalnumberNumber of distinct blacklisted wallets the account would have on this chain after saving.
error.limitnumberMaximum distinct blacklisted wallets per account on this chain.
error.detailsarray<object>Only present when at least one field-level validation issue exists.
error.details[].fieldstring✓Request field this issue refers to, or a dotted path such as buy.amount.
error.details[].reasonstring✓Why that field was rejected.
error.details[].codestringStable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change.
metaobject✓Request id for this failure.
meta.request_idstring✓Id of this request. Also sent as the X-Request-Id response header.

403 — insufficient_scope / ip_not_allowed

FieldTypeRequiredDescription
errorobject✓Why the request failed.
error.codestring✓Stable machine-readable error code.
error.messagestring✓Human-readable explanation of the error.
error.totalnumberNumber of distinct blacklisted wallets the account would have on this chain after saving.
error.limitnumberMaximum distinct blacklisted wallets per account on this chain.
error.detailsarray<object>Only present when at least one field-level validation issue exists.
error.details[].fieldstring✓Request field this issue refers to, or a dotted path such as buy.amount.
error.details[].reasonstring✓Why that field was rejected.
error.details[].codestringStable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change.
metaobject✓Request id for this failure.
meta.request_idstring✓Id of this request. Also sent as the X-Request-Id response header.

429 — rate_limited (Retry-After response header set)

FieldTypeRequiredDescription
errorobject✓Why the request failed.
error.codestring✓Stable machine-readable error code.
error.messagestring✓Human-readable explanation of the error.
error.totalnumberNumber of distinct blacklisted wallets the account would have on this chain after saving.
error.limitnumberMaximum distinct blacklisted wallets per account on this chain.
error.detailsarray<object>Only present when at least one field-level validation issue exists.
error.details[].fieldstring✓Request field this issue refers to, or a dotted path such as buy.amount.
error.details[].reasonstring✓Why that field was rejected.
error.details[].codestringStable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change.
metaobject✓Request id for this failure.
meta.request_idstring✓Id of this request. Also sent as the X-Request-Id response header.

500 — internal_error

FieldTypeRequiredDescription
errorobject✓Why the request failed.
error.codestring✓Stable machine-readable error code.
error.messagestring✓Human-readable explanation of the error.
error.totalnumberNumber of distinct blacklisted wallets the account would have on this chain after saving.
error.limitnumberMaximum distinct blacklisted wallets per account on this chain.
error.detailsarray<object>Only present when at least one field-level validation issue exists.
error.details[].fieldstring✓Request field this issue refers to, or a dotted path such as buy.amount.
error.details[].reasonstring✓Why that field was rejected.
error.details[].codestringStable machine-readable reason for a strategy spec issue, for example unsupported_leaf or pump_callers_required. Present only on strategy spec validation errors; reason may change.
metaobject✓Request id for this failure.
meta.request_idstring✓Id of this request. Also sent as the X-Request-Id response header.
Example request
curl -X POST "https://api.apm.fun/v1/cell-token" \
  -H "Authorization: Bearer apm_live_<prefix>.<secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "solana"
  }'
Example response 200
{
  "data": {
    "token": "string",
    "expires_at": "2026-01-15T09:30:00Z",
    "cell_id": "cfg_8f2a1c9b",
    "gateway_url": "string",
    "scopes": [
      "orders:read"
    ]
  },
  "meta": {
    "request_id": "cfg_8f2a1c9b"
  }
}