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.

These examples use a Compose Key against the hosted API.
export COMPOSE_MARKET_API_KEY="compose-..."
export COMPOSE_API_URL="https://api.compose.market"
Use /v1/* when you want Compose receipts or x402 behavior. Use /external/v1/* when you are configuring an OpenAI-compatible IDE, SDK, or app.

List models

curl "$COMPOSE_API_URL/v1/models" \
  -H "Authorization: Bearer $COMPOSE_MARKET_API_KEY"
The response is a generated catalog. Use data[].modelId as the model string on native routes.
{
  "object": "list",
  "data": [
    {
      "modelId": "gpt-5.5",
      "provider": "azure",
      "input": ["text", "image"],
      "output": ["text"]
    }
  ]
}

Make a chat call

Native routes are OpenAI-shaped, with Compose payment metadata added where it belongs.
curl "$COMPOSE_API_URL/v1/chat/completions" \
  -H "Authorization: Bearer $COMPOSE_MARKET_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-chain-id: 43113" \
  -d '{
    "model": "gpt-5.5",
    "messages": [
      { "role": "user", "content": "Write a terse deployment checklist." }
    ]
  }'
The response is an OpenAI-compatible chat completion. Native responses may include compose_receipt in the JSON body, and receipt data is also exposed through X-Compose-Receipt when available.

Stream a chat call

curl -N "$COMPOSE_API_URL/v1/chat/completions" \
  -H "Authorization: Bearer $COMPOSE_MARKET_API_KEY" \
  -H "Content-Type: application/json" \
  -H "x-chain-id: 43113" \
  -d '{
    "model": "gpt-5.5",
    "stream": true,
    "stream_options": { "include_usage": true },
    "messages": [
      { "role": "user", "content": "Say hello in three words." }
    ]
  }'
Streaming uses Server-Sent Events. Native chat streams emit OpenAI chat completion chunks, usage chunks, optional Compose receipt events, and then [DONE].

Use an external OpenAI-compatible client

Use /external/v1 when the client expects an OpenAI base URL.
curl "$COMPOSE_API_URL/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": "Hello from an OpenAI-compatible client." }
    ]
  }'
External responses keep the body clean for OpenAI-compatible clients. Provider diagnostics are still available in headers:
HeaderMeaning
x-compose-public-modelPublic catalog ID the client requested.
x-compose-upstream-providerProvider selected by the resolver.
x-compose-upstream-modelProvider wire model sent to the adapter.