Create an API key
Body:
budgetLimit uses USDC atomic units. 1000000 means 1 USDC.
Response:
402 with details.
Use a key
Key purposes
Manage keys
x-session-user-address. The response includes budget state but not token material.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Budgeted bearer credentials for Compose APIs and external OpenAI-compatible clients.
POST /api/keys
| Header | Description |
|---|---|
x-session-user-address | Owner wallet address. |
x-network-id | Chain for balance, allowance, and settlement checks. |
{
"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
}
402 with details.
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" }
]
}'
| Purpose | Use it for | Notes |
|---|---|---|
api | IDEs, scripts, backend integrations, external OpenAI-compatible clients | Independent budget. Best fit for external use. |
session | First-party app sessions | Must match the active session for the same wallet and chain. |
GET /api/keys
x-session-user-address. The response includes budget state but not token material.
GET /api/keys/{keyId}
Authorization: Bearer compose-...
DELETE /api/keys/{keyId}
Authorization: Bearer compose-...
| Header | Meaning |
|---|---|
x-key-budget-limit | Original budget. |
x-key-budget-used | Settled amount recorded against the key. |
x-key-budget-remaining | Spendable budget left. |
x-key-final-amount-wei | Amount settled for the request. |
x-key-tx-hash | Settlement transaction hash when available. |