Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.compose.market/llms.txt

Use this file to discover all available pages before exploring further.

A Compose Key is not a provider API key. It is a signed Compose credential with an owner wallet, chain, expiry, purpose, and budget. Use API-purpose keys for external apps. Use session-purpose keys for the first-party app session flow.

Create an API key

POST /api/keys
Headers:
HeaderDescription
x-session-user-addressOwner wallet address.
x-chain-idChain for balance, allowance, and settlement checks.
Body:
{
  "budgetLimit": 1000000,
  "expiresAt": 1790000000000,
  "chainId": 43113,
  "purpose": "api",
  "name": "OpenCode"
}
budgetLimit uses USDC atomic units. 1000000 means 1 USDC. Response:
{
  "keyId": "f65a...",
  "token": "compose-...",
  "budgetLimit": "1000000",
  "budgetUsed": "0",
  "budgetRemaining": "1000000",
  "purpose": "api",
  "chainId": 43113
}
The API checks funding before it creates the key. If the wallet lacks USDC balance or allowance for the requested budget, the endpoint returns 402 with details.

Use a key

curl https://api.compose.market/external/v1/chat/completions \
  -H "Authorization: Bearer $COMPOSE_MARKET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      { "role": "user", "content": "Deploy" }
    ]
  }'
On each paid call, Compose validates the key, reserves budget, runs the service, prices the result, then settles the final amount.

Key purposes

PurposeUse it forNotes
apiIDEs, scripts, backend integrations, external OpenAI-compatible clientsIndependent budget. Best fit for external use.
sessionFirst-party app sessionsMust match the active session for the same wallet and chain.

Manage keys

GET /api/keys
Lists keys for x-session-user-address. The response includes budget state but not token material.
GET /api/keys/{keyId}
Authorization: Bearer compose-...
Returns one key. The bearer key must belong to the same wallet as the target key.
DELETE /api/keys/{keyId}
Authorization: Bearer compose-...
Revokes a key. Revocation uses signed key ownership, not an unsigned wallet header.

Budget headers

HeaderMeaning
x-compose-key-budget-limitOriginal budget.
x-compose-key-budget-usedSettled amount recorded against the key.
x-compose-key-budget-remainingSpendable budget left.
x-compose-key-final-amount-weiAmount settled for the request.
x-compose-key-tx-hashSettlement transaction hash when available.