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 uses Server-Sent Events for streaming. Native routes can include Compose events alongside OpenAI-shaped chunks. External routes remove Compose events so OpenAI-compatible clients only see the stream shape they expect.

Chat streaming

curl -N https://api.compose.market/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": "Give me one line." }
    ]
  }'
Chat streams use OpenAI chat completion chunks:
data: {"id":"resp_...","object":"chat.completion.chunk","choices":[{"delta":{"role":"assistant","content":"Hello"}}]}

data: {"id":"resp_...","object":"chat.completion.chunk","choices":[{"delta":{},"finish_reason":"stop"}]}

data: [DONE]
When usage is available, Compose sends a final usage chunk before [DONE].

Responses streaming

POST /v1/responses streams Responses-style events. Use it when you want response IDs, input item retrieval, or previous_response_id history.
{
  "model": "gpt-5.5",
  "stream": true,
  "input": [
    { "role": "user", "content": "Summarize the deployment log." }
  ]
}
The API stores response records for retrieval through:
MethodPath
GET/v1/responses/{id}
GET/v1/responses/{id}/input_items
POST/v1/responses/{id}/cancel

Compose events on native routes

Native streams can include named events:
EventMeaning
compose.receiptPayment settled. Contains final amount, network, line items, and optional transaction hash.
compose.errorStructured stream error before the stream closes.
compose.video.statusVideo job status update.
External streams remove these events and keep the stream OpenAI-shaped.

Video status streaming

GET /v1/videos/{id}/stream
The endpoint polls the provider job and sends compose.video.status until the job is completed or failed. Optional query parameters:
ParameterDefaultBounds
pollIntervalMs2000500 to 30000
timeoutMs6000005000 to 3600000