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 accepts OpenAI-style function tools on text models that support tool calling. The gateway passes tool definitions to the selected provider adapter and returns tool calls in OpenAI-compatible response shapes. Compose does not run the function. Your client or runtime owns permissions, sandboxing, side effects, and the follow-up request.

Chat completions example

curl 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",
    "messages": [
      { "role": "user", "content": "What is the weather in Rome?" }
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_weather",
          "description": "Get current weather for a city.",
          "parameters": {
            "type": "object",
            "properties": {
              "city": { "type": "string" }
            },
            "required": ["city"]
          }
        }
      }
    ],
    "tool_choice": "auto"
  }'
Tool calls return as:
{
  "tool_calls": [
    {
      "id": "call_...",
      "type": "function",
      "function": {
        "name": "get_weather",
        "arguments": "{\"city\":\"Rome\"}"
      }
    }
  ]
}
Send the tool result back as a tool message:
{
  "role": "tool",
  "tool_call_id": "call_...",
  "content": "{\"temperature_c\":18,\"condition\":\"clear\"}"
}

Provider behavior

The gateway normalizes the request shape. Provider behavior still differs:
Provider familyNotes
OpenAIChat requests with function tools and reasoning parameters may use the Responses wire internally when required by the model.
Azure OpenAIUses the same OpenAI-style message lowering path for tools, tool choice, response format, and custom params.
GeminiTool-call state can include provider metadata needed for later turns; Compose preserves it where the adapter exposes it.
OpenAI-compatible providersTool support depends on the selected model and provider. Check the catalog row before relying on it.

External clients

OpenCode and similar IDEs send large tool payloads. The external gateway keeps those fields intact and passes AI SDK wrapper fields through the core normalizer where they are supported. External content-filter errors are sanitized in the response body. Diagnostic headers still show the selected provider and model when safe:
x-compose-upstream-provider: azure
x-compose-upstream-model: gpt-5.5
x-compose-public-model: gpt-5.5