API 参考文档 v1
获取 API Key 获取 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.

所需 Scope: orders:read

请求体 application/json

字段类型必填说明
chainenum ("solana" | "bsc" | "robinhood")✓Chain whose enabled Cell will receive the token. Each chain requires a separate token.

响应

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

字段类型必填约束说明
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)

字段类型必填说明
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

字段类型必填说明
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)

字段类型必填说明
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

字段类型必填说明
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.
请求示例
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"
  }'
响应示例 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"
  }
}