API docs
Every write endpoint returns an unsigned payload. Nothing accepts a private key. Your SDK or agent host signs locally.
Risks and limits
- Each venue liquidates independently.
- Legging risk is yours.
- A trade-only key can still trade and liquidate its account.
- Not available in refused regions.
- Receipts prove what Capstan did, not venue fill quality.
REST (Capstan API 1.0.0)
Non-custodial multi-venue perps API. Every write endpoint returns an unsigned payload; nothing accepts a private key. Each venue liquidates independently.
Base URL: https://api.get-capstan.com/v1
| Method | Path | What it does | Auth | Price |
|---|---|---|---|---|
GET | /v1/account | Your plan, limits and credits | API key | Free |
POST | /v1/account/keys | Create a Capstan API key for your wallet (shown once) | Owner signature | Free |
POST | /v1/agents/policy | Store an agent policy signed by your main wallet | Owner signature | Free |
POST | /v1/agents/{agentRef}/kill | Stop an agent on the Capstan relay and get the venue revocation steps for your wallet | Owner signature | Free |
GET | /v1/alerts/webhooks | Your alert webhooks and their state | Owner signature | Free |
POST | /v1/alerts/webhooks | Register a webhook for your alerts: liquidation distance, unhedged spread plans, approval expiry, policy refusals | Owner signature | Free |
DELETE | /v1/alerts/webhooks/{id} | Remove one of your alert webhooks | Owner signature | Free |
GET | /v1/credits | Your premium-call credit balance | API key | Free |
POST | /v1/credits/topup/100 | Buy $100 of premium-call credits | x402 payment | $100 |
POST | /v1/credits/topup/20 | Buy $20 of premium-call credits | x402 payment | $20 |
POST | /v1/credits/topup/5 | Buy $5 of premium-call credits | x402 payment | $5 |
GET | /v1/eligibility | Whether orders on a venue are available from your region | None | Free |
GET | /v1/funding | Latest observed funding per venue for an asset, data-only venues included | None | Free |
GET | /v1/funding/forecast | Next 8 funding settlements per market (an estimate from observed rates) | x402 payment | $0.01 |
GET | /v1/health | Liveness check | None | Free |
GET | /v1/history/funding | Funding history rows, $0.05 per 1,000 rows, pages of 10,000 | x402 payment | $0.05 |
GET | /v1/markets | Markets across venues, each with its own contract details and whether it is executable | None | Free |
GET | /v1/markets/{id}/book | Order book for one market (top levels, newest cached) | None | Free |
POST | /v1/onboarding/build | Build the onboarding steps your main wallet signs (agent approval, builder fee approval, declaration) | Owner signature or API key | Free |
GET | /v1/onboarding/preflight | What onboarding on a venue needs for this wallet: free agent slots, builder approval, current agents | None | Free |
POST | /v1/onboarding/submit | Submit the signed onboarding steps; the venue records the agent and the builder approval | Owner signature or API key | Free |
GET | /v1/openapi.json | The OpenAPI 3.1 document for this API | None | Free |
POST | /v1/orders/build | Build an unsigned order payload for your delegated key to sign | Owner signature or API key | Free |
POST | /v1/orders/cancel/build | Build an unsigned cancel payload | Owner signature or API key | Free |
POST | /v1/orders/close-all/build | Build reduce-only close payloads for every position of your active agents | Owner signature or API key | Free |
POST | /v1/orders/submit | Submit a signed envelope through the relay | Owner signature or API key | Free |
GET | /v1/positions | Your open positions on each venue, each with its own liquidation price | Owner signature | Free |
GET | /v1/quote | Quote every venue side by side (query form) | None | Free |
POST | /v1/quote | Quote every venue side by side: venue fee, builder fee, slippage and observed funding | None | Free |
GET | /v1/receipts | Your receipts, newest first (needs your signature) | Owner signature | Free |
POST | /v1/receipts/claim | Claim the receipt for an order you sent to the venue directly | Owner signature or API key | Free |
GET | /v1/receipts/{id} | One receipt by id | None | Free |
GET | /v1/receipts/{id}/proof | Merkle proof of a receipt in its hourly anchored root | None | Free |
GET | /v1/receipts/{id}/verify | Full check of a receipt: signature, leaf, proof and the on-chain root | None | Free |
GET | /v1/risk | Your risk view: every venue's account and liquidation price on its own | Owner signature | Free |
POST | /v1/risk/ingest | Ingest an Aster account read signed by your own agent key | Owner signature | Free |
GET | /v1/risk/liq-heatmap | Liquidation heatmap per venue for one asset, from public account samples | x402 payment | $0.02 |
POST | /v1/risk/snapshot | Risk snapshot for any addresses from public venue reads (Aster needs the owner's own signed read) | x402 payment | $0.01 |
POST | /v1/spreads/plan | Plan a funding-rate spread trade (at-risk; legging risk is yours). The plan must be acknowledged before it runs on your side | Owner signature | Free |
GET | /v1/spreads/scan | Funding-rate spread trades (at-risk) across reviewed equivalent markets, with cost, breakeven and both liquidation prices | x402 payment | $0.02 |
GET | /v1/spreads/{id} | A spread plan and its events | Owner signature | Free |
POST | /v1/spreads/{id}/ack | Acknowledge a spread plan with your wallet or your agent key | Owner signature | Free |
POST | /v1/spreads/{id}/events | Report a step of a spread plan run on your side | Owner signature | Free |
GET | /v1/venues | Venue capabilities: execution, key type, delegation, builder fee rail and collateral | None | Free |
MCP tools
Streamable HTTP. Read only unless a write tool is called. No tool accepts a key: builds return unsigned payloads that your host signs with the SDK.
| Tool | Input | Output |
|---|---|---|
capstan_markets | { venue?, asset?, executableOnly? } | { markets: Market[] } |
capstan_funding | { asset } | FundingSnapshot[] for every venue, data-only venues included |
capstan_quote | QuoteRequest (canonicalAsset or marketIds (10 at most), side, sizeBase or notionalUsd, leverage, holdHours, orderType, limitPx?, owner?) | RouteQuote with a per-venue cost table |
capstan_onboarding_build | { venue, owner, agentAddress or lighterPubKey, builderMaxBps?, policy? } | OnboardingBundle: the steps your main wallet signs, one plain sentence each |
capstan_build_order | { owner, agentRef, intent, mode } | UnsignedVenuePayload with its preview (sign it locally) |
capstan_submit | { buildId, signedEnvelope } only | { order, receiptId } |
capstan_cancel_build | { owner, agentRef, venueOrderId } | UnsignedVenuePayload |
capstan_positions | { owner, venues?, ownerRead } | your positions per venue, each with its own liquidation price |
capstan_risk | { owner, ownerRead } or { addresses } | RiskView per venue; free for your own, paid (x402, $0.01) for other addresses |
capstan_spread_scan | { asset?, minBreakevenHours? } | ranked pairs (x402, $0.02) |
capstan_spread_plan | { owner, equivalenceId, sizeBase, leverage, hedgeFailurePolicy } | SpreadPlan with riskLabel and ackRequired: true |
capstan_plan_status | { planId } | the plan and its events |
capstan_set_policy | { policy, ownerSig } | { policyId } |
capstan_kill | { agentRef, sig, message, closeAll? } | relayBlocked: true, the venue revocation steps and, when asked, reduce-only close payloads |
capstan_get_receipt | { receiptId } | Receipt |
capstan_verify_receipt | { receiptId } or { receipt } | { valid, checks } (signature, leaf, proof, on-chain root) |
capstan_eligibility | { venue? } | { allowed, code }; when refused the text is "Not available in your region." |
