Skip to main content
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

Tool calls return as:
Send the tool result back as a tool message:

Responses example with two parallel calls

Responses tools are flat; they do not use Chat Completions’ nested function object:
A model may return both calls in the same ordered response.output. Each call has two different stable identifiers:
Execute both functions concurrently, then return both results together using the call_id values—not the output-item id values:
With store: false, replay the complete previous response.output first—including reasoning and both function-call items—then append both function_call_output items.

Provider behavior

The gateway normalizes the request shape. Provider behavior still differs:

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: