Skip to main content
POST
/
v1
/
chat
/
completions
Chat and Responses
curl --request POST \
  --url https://api.compose.market/v1/chat/completions \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {}
  ],
  "stream": true,
  "tools": [
    {}
  ],
  "tool_choice": {},
  "response_format": {},
  "input": {},
  "previous_response_id": "<string>",
  "modalities": [
    {}
  ]
}
'

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.

Use these routes when you want native Compose receipts, raw x402 support, or Compose Key billing.

Routes

MethodPathStreamingDescription
POST/v1/chat/completionsYesOpenAI Chat Completions-shaped request and response.
POST/v1/responsesYesResponses-shaped input, tools, multimodal content, and stored response IDs.
GET/v1/responses/{id}NoRetrieve a stored response record.
GET/v1/responses/{id}/input_itemsNoReturn stored input items for a response.
POST/v1/responses/{id}/cancelNoCancel a stored response or async media job.
POST/api/inferenceYesLegacy alias for /v1/chat/completions.

Headers

Authorization
string
Bearer compose-... for Compose Key billing.
PAYMENT-SIGNATURE
string
Raw x402 payment signature for x402-aware clients.
x-x402-max-amount-wei
string
Maximum USDC atomic amount for raw x402 upto payments.

Chat body

model
string
required
Public catalog model ID.
messages
array
required
Non-empty OpenAI-style chat message array.
stream
boolean
Enables SSE streaming. Non-boolean values return 400 invalid_stream.
tools
array
OpenAI function tool definitions for models that support tool calling.
tool_choice
string | object
none, auto, required, or a named function choice.
response_format
object
Text, JSON object, or JSON schema response format when the provider supports it.

Responses body

model
string
required
Public catalog model ID.
input
string | array
required
Responses-style input. Required unless previous_response_id supplies history.
previous_response_id
string
Response ID to hydrate prior messages.
modalities
array
Requested output modalities.

Streaming events

Native streams send OpenAI-compatible data frames plus Compose events:
EventDescription
data: {...}Chat or Responses chunk.
event: compose.receiptIn-band settlement receipt before stream close.
event: compose.errorStructured Compose error frame.
data: [DONE]Stream terminator.