Skip to main content
POST
Chat and Responses
Use these routes when you want native Compose receipts, raw x402 support, or Compose Key billing.

Routes

Headers

string
Bearer compose-... for Compose Key billing.
string
Raw x402 payment signature for x402-aware clients.
string
Maximum USDC atomic amount for raw x402 upto payments.

Chat body

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

Responses body

string
required
Public catalog model ID.
string | array
required
Responses-style input. Required unless previous_response_id supplies history.
string
Response ID to hydrate exact prior input/output items. Stored state is durable; if it is unavailable, the API returns 503 response_state_unavailable instead of silently falling back to process memory.
array
Requested output modalities.
array
Flat Responses function tools: { "type": "function", "name": "...", "description": "...", "parameters": {...} }.
boolean
Allows multiple function calls only when the selected catalog model declares parallel tool support.
boolean
false disables response-state persistence. Stateless continuations must replay the complete previous response.output, including reasoning and function-call items, followed by every function_call_output.

Streaming events

Native streams send OpenAI-compatible data frames plus Compose events: Responses data frames preserve the official output-item lifecycle and distinct IDs: response.output_item.added, response.function_call_arguments.delta, response.function_call_arguments.done, response.output_item.done, and a terminal event whose response.output contains every ordered item.