Skip to main content

Tools and Agents

The Model Gateway's Responses API (/v1/responses) is an agentic entry point. Give the model a task and a set of gateway-hosted tools, and the gateway runs the tool-call loop for you: it dispatches each tool call the model makes, feeds the result back, and repeats until the model returns a final answer, with token usage aggregated across the whole run. By default, the gateway returns one buffered response. Set "stream": true to receive the trace as Server-Sent Events while the loop runs. You get multi-step, tool-using behavior from a single API call, with no orchestration to build or host.

Tools over MCP

Tools are provided through the Model Context Protocol (MCP), from a catalog shared across the platform. The same tools are available to API callers and to the built-in Chat.

  • RAG is available as a tool, so a model can search your documents mid-conversation instead of you calling retrieval separately.
  • Your own MCP servers connect the loop to proprietary systems and data. Deploy an MCP server image — subject to your deployment restrictions — and its tools join the catalog.

Use tools through the API

Use the Responses API to discover the Model Gateway tools available to your API key, let a model call them, and inspect the complete tool-calling trace.

Use Model Gateway tools with the Responses API

Access control

Every tool invocation is authorized per tenant, just like model and RAG access. Tenants set function tool policy and allowlists, so a request can only reach the tools it's permitted to use.

Client-side tools

For client-driven agents — coding assistants and similar harnesses — the client runs the agent loop. Local tools such as the filesystem and shell execute on the client, while gateway-hosted RAG and MCP tools are available from the Model Gateway's remote MCP endpoint.

See Configure Coding Agents for an OpenCode setup guide and the settings used by other OpenAI-compatible coding agents.