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:

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: