tools array. The AI Gateway presents it to the model, runs each tool call, and returns the model’s final answer.
Server tools are available on:
The selected model must support tool calling.
Server tools and function tools
Server tools can share a request with function tools. Provider-hosted tools such as
web_search or file_search are separate from the orq:* tools documented here.
How server tools work
- Add one or more server tools to the request’s
toolsarray. - The model chooses whether to call a tool and supplies its runtime arguments.
- The AI Gateway executes the tool and returns the result to the model.
- The model can call another tool or finish the response.
max_tool_calls limits the server-side loop. Chat Completions defaults to 10 calls and accepts values from 1 to 30. The field is optional on the Responses API.
Quick start
This example gives the model access to web search and the current date. The model can use either tool, both tools, or neither. The upstream OpenAI TypeScript types do not defineorq:* tools, so the TypeScript examples cast the tools array.
Available tools
Web search
orq:web_search: Search the public web for current information.Web fetch
orq:web_fetch: Fetch and extract text from a public URL.Datetime
orq:datetime: Return the current date and time in an IANA timezone.Image generation
orq:image_generation: Generate an image with a configured image model.Code interpreter
orq:code_interpreter: Run Python in an isolated sandbox.Shell
orq:shell: Run commands in an isolated Linux sandbox.Apply patch
orq:apply_patch: Validate file changes before the application applies
them.Knowledge bases
retrieve_knowledge_bases and query_knowledge_base: List and query
knowledge bases in the workspace.Search models
orq:search_models: Search the Orq.ai model catalog by capability and
cost.Subagent
orq:subagent: Delegate a self-contained task to another model.Advisor
orq:advisor: Ask another model for advice during a response.Fusion
orq:fusion: Compare answers from a panel of models.Combine server tools with functions
Function tools keep the standard OpenAI shape. The AI Gateway executesorq:* tools and returns function calls to the application.
JSON
Usage reporting
When a counted server tool runs, the response includes its call count inusage.server_tool_use.
JSON
Knowledge-base retrieval and apply-patch calls do not add a field to
usage.server_tool_use.
Chat Completions limitations
OnPOST /v3/router/chat/completions, a request that includes an orq:* server tool cannot also include:
plugins- legacy
guardrailsorevaluators ngreater than1- provider-hosted tool types such as
web_searchorfile_search
400 for these combinations. Function tools remain supported alongside server tools.
Chat Completions is stateless unless store is set to true.