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.

This is the compact route map for hosted inference. For request examples, start with the quickstart and modality pages.

Auth modes

Route familyRaw x402Compose KeyNotes
/v1/*YesYesNative Compose inference.
/external/v1/*NoYesOpenAI-compatible external clients.
/.well-known/opencodeNoNoPublic config document.

Model routes

MethodPathDescription
GET/v1/modelsGenerated model catalog.
GET/v1/models/allExtended generated catalog when bundled.
POST/v1/models/searchCatalog search and filters.
GET/v1/models/{model}One model row.
GET/v1/models/{model}/paramsOptional parameter metadata for a model.
GET/external/v1/modelsOpenAI-shaped model list.
GET/external/v1/models/{model}One OpenAI-shaped model row. Slash-containing IDs are supported.

Generation routes

MethodPathStreamingNotes
POST/v1/chat/completionsYesOpenAI Chat Completions shape.
POST/v1/responsesYesResponses-style input and output.
GET/v1/responses/{id}NoRetrieves a stored response record.
GET/v1/responses/{id}/input_itemsNoReturns stored input items.
POST/v1/responses/{id}/cancelNoCancels a response or async job.
POST/v1/embeddingsNoOpenAI embeddings shape.
POST/v1/images/generationsProvider-dependentImage generation.
POST/v1/images/editsNoImage editing.
POST/v1/audio/speechNoReturns audio bytes.
POST/v1/audio/transcriptionsNoReturns text or JSON.
POST/v1/videos/generationsNoSubmits video generation.
GET/v1/videos/{id}NoPolls video job status.
GET/v1/videos/{id}/streamYesStreams video job status.
External generation routes mirror the supported OpenAI-compatible subset under /external/v1. The API also registers POST /api/inference as a legacy alias for chat completions.

Request fields

The core normalizer understands standard OpenAI fields and keeps provider-specific pass-through fields in customParams when possible. Common fields:
FieldRoutesNotes
modelAll generation routesPublic catalog ID.
messagesChat completionsOpenAI chat message array.
inputResponses and embeddingsResponses-style content or embedding input.
toolsText routesOpenAI function tools.
tool_choiceText routesnone, auto, required, or named function choice.
response_formatText routestext, json_object, or json_schema.
streamText and streamable media routesMust be boolean.
stream_optionsStreaming routesPreserved; usage inclusion is forced where metering requires it.
parallel_tool_callsText routesPreserved for providers that support it.
reasoning_effortText routesPassed through when compatible with the selected provider/model.

Response headers

HeaderDescription
X-Request-IdRequest ID minted or accepted by the root middleware.
X-Compose-ReceiptNative Compose receipt.
x-compose-response-idResponse ID for streaming native responses.
x-routing-primary-modelPrimary model selected by routing policy.
x-routing-final-modelFinal model after retry policy.
x-routing-attemptsNumber of provider attempts.
x-routing-fallback-usedfalse with the single-target routing policy.
x-compose-public-modelExternal route public model ID.
x-compose-upstream-providerExternal route provider selected by resolver.
x-compose-upstream-modelExternal route provider wire model.

Error shape

Native and external routes return OpenAI-style errors:
{
  "error": {
    "message": "model is required",
    "type": "invalid_request_error",
    "code": "missing_model"
  }
}
External routes sanitize upstream content-filter messages and redact URLs. Diagnostic provider/model headers remain available when safe.