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.

The facilitator endpoints expose the x402 pieces directly. The payment intent endpoints expose the Compose reserve-settle-abort flow used by Compose Keys and metered calls.

x402 endpoints

MethodPathPurpose
GET/api/x402/facilitator/supportedLists supported x402 versions, networks, and schemes.
GET/api/x402/facilitator/chainsLists configured chains, CAIP-2 network IDs, USDC addresses, explorers, and default chain ID.
POST/api/x402/facilitator/verifyVerifies a payment payload against payment requirements.
POST/api/x402/facilitator/settleSettles a payment payload.
verify and settle accept x402-shaped paymentPayload and paymentRequirements objects.

Payment-required challenge

Raw x402 calls start with a normal request. If no valid payment is present, Compose responds with:
HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: <base64-json>
Content-Type: application/json
The client signs the requirement and retries with:
PAYMENT-SIGNATURE: <signed-payment-payload>

Payment intents

MethodPathPurpose
POST/api/payments/prepareAuthorizes an exact amount, a metered quote, or a budget cap.
POST/api/payments/settleSettles an intent with a final amount or metered usage.
POST/api/payments/abortReleases a prepared intent when work fails before settlement.
POST/api/payments/meter/modelPrices model usage using catalog pricing.

Quote model usage

POST /api/payments/meter/model
Content-Type: application/json
{
  "modelId": "gpt-5.5",
  "provider": "azure",
  "modality": "text",
  "usage": {
    "promptTokens": 1000,
    "completionTokens": 250,
    "totalTokens": 1250
  }
}
The response contains the resolved model, meter subject, line items, provider amount, platform fee, and final USDC atomic amount.

Receipt headers

HeaderMeaning
PAYMENT-RESPONSEEncoded x402 settlement response.
X-Transaction-HashSettlement transaction hash when available.
X-Compose-ReceiptCompose receipt with amount, network, line items, and settlement time.
x-payment-intent-idPrepared payment intent ID.