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.

Compose.Market uses x402 for paid HTTP. The pattern is plain: a request costs money, the API asks for payment, the client pays, and the API returns the result. For humans and IDEs, raw x402 is often too much ceremony. Compose Keys cover that case. A Compose Key is a budgeted bearer credential, so an external app can send Authorization: Bearer compose-... and keep using normal OpenAI-compatible HTTP.

Pick the right flow

Use caseUse thisWhy
OpenCode, Cline, Zed, custom OpenAI-compatible clientsCompose Key on /external/v1/*These clients expect bearer auth, not a 402 challenge loop.
First-party app sessionsSession-purpose Compose KeyThe app can reserve and settle budget without asking for a wallet signature on every call.
Wallet-native clientsRaw x402 on /v1/*, /agent/*, or /workflow/*The client can sign PAYMENT-REQUIRED and retry with PAYMENT-SIGNATURE.
SDKs that want receipts in the responseNative /v1/*Native routes expose Compose receipt data. External routes keep OpenAI-compatible bodies clean.

What happens on a paid inference call

The important detail is the order. Compose does not guess the bill from the prompt. It prices the request from provider output: token usage for text and embeddings, media evidence for image/audio/video, and the model pricing stored in the generated catalog.

Exact vs upto

SchemeMeaning
exactThe amount is known before execution. The client authorizes that amount.
uptoThe client authorizes a maximum. Compose settles the measured amount, capped by that maximum.
Usage-priced inference uses upto because the final token count or media evidence is known only after the provider responds.

Headers you will see

HeaderDirectionMeaning
PAYMENT-REQUIREDResponseEncoded x402 payment requirement for raw x402 clients.
PAYMENT-SIGNATURERequestSigned x402 payment payload on the retry request.
AuthorizationRequestBearer compose-... for Compose Key clients.
X-Compose-ReceiptResponseBase64 JSON receipt for native routes.
x-payment-intent-idResponsePrepared payment intent used for reserve/settle/abort flows.
x-compose-key-budget-remainingResponseRemaining key budget after settlement.

Native and external routes

Native routes are for Compose-aware clients. External routes are for OpenAI-compatible tools.
Route familyBody shapePaymentReceipt behavior
/v1/*OpenAI-style plus Compose fieldsRaw x402 or Compose KeyReceipts can appear in headers and native response bodies.
/external/v1/*OpenAI-compatibleCompose Key onlyBodies stay OpenAI-shaped; Compose internals stay in headers.