Skip to main content
POST
/
external
/
v1
/
chat
/
completions
External OpenAI-compatible inference
curl --request POST \
  --url https://api.compose.market/external/v1/chat/completions \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {}
  ],
  "input": {},
  "tools": [
    {}
  ],
  "stream_options": {}
}
'

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.

External routes are for clients that can set an OpenAI-compatible baseURL and bearer token but do not understand x402 challenge flows. They use Compose Key auth only.

Routes

MethodPathDescription
GET/.well-known/opencodeRemote OpenCode config document.
GET/external/opencodeCompose provider config with env-based API key placeholder.
GET/external/v1/modelsOpenAI-shaped model list.
GET/external/v1/models/{model}One OpenAI-shaped model row. Slash-containing IDs are supported.
POST/external/v1/chat/completionsOpenAI-compatible chat completions.
POST/external/v1/responsesOpenAI-compatible Responses-style requests.
POST/external/v1/embeddingsOpenAI-compatible embeddings.
POST/external/v1/images/generationsImage generation.
POST/external/v1/audio/speechSpeech generation.
POST/external/v1/audio/transcriptionsAudio transcription.
POST/external/v1/videos/generationsVideo generation.

Headers

Authorization
string
required
Bearer compose-.... Missing or invalid keys return an OpenAI-shaped 401.

Request body

model
string
required
Public catalog model ID exactly as returned by /external/v1/models.
messages
array
Chat Completions message array.
input
string | array
Responses or embeddings input.
tools
array
OpenAI function tool definitions. Tool calls are returned in OpenAI shape when the provider emits them.
stream_options
object
Preserved for streaming clients. Usage inclusion is forced when needed for metering.

Diagnostic headers

HeaderDescription
x-compose-public-modelPublic catalog ID requested by the client.
x-compose-upstream-providerProvider selected by the catalog resolver.
x-compose-upstream-modelProvider wire model used upstream.
External response bodies do not include compose_receipt. Upstream content-filter errors are sanitized while keeping the diagnostic headers above.