Skip to main content
Use Cases
  • Answering questions about events beyond the model’s training cutoff.
  • Grounding responses in live data (pricing, availability, breaking news).
  • Research assistants that need to cite verifiable, up-to-date sources.
  • Customer support bots that look up current documentation or policies at query time.

Overview

Use POST /responses on the AI Gateway with the same request shape as the OpenAI Responses API: model, input, and a tools array that includes a built-in web search entry. The router forwards search to each provider’s native capability when the model supports it. There is no separate Perplexity or Parallel tool in the router; the supported contract is OpenAI-style web_search / web_search_preview tools on /responses, mapped to Anthropic and Google where applicable.
Prefer models whose metadata indicates web search support. See Supported Models and your workspace model list.

Quick start

Use the OpenAI SDK against the AI Gateway base URL and call the Responses API directly.
Endpoint: POST https://api.orq.ai/v3/router/responses

Tool definitions

Request tools entries use the discriminated type field, matching the gateway schema.

web_search_preview

The router accepts the full tool object on /responses. OpenAI requests pass tools through to the upstream Responses API. Anthropic and Google paths map web_search / web_search_preview to native web search tools; fields the upstream API does not support may be ignored.

include (optional)

You can ask for additional fields on web search output items, aligned with OpenAI Responses include: Example request body:

Output: web_search_call

Responses can contain output items with "type": "web_search_call": Exact payload shape matches what the provider returns; streaming uses the same event model as other /responses streams.

Provider behavior

OpenAI

Tools and include are passed to client.responses.create with your model id (for example openai/o3). Use the same parameters OpenAI documents for web search on the Responses API.

OpenAI

Set up your OpenAI API key to use o3 and GPT-4o with web search.

Anthropic

web_search and web_search_preview in tools are mapped to Anthropic’s web search tool for the Messages path used under /responses.

Anthropic

Set up your Anthropic API key to use Claude with web search.

Google Gemini

The same tool types enable Google Search grounding (googleSearch) for Gemini models that support it.

Google AI

Set up your Google AI API key to use Gemini models with Google Search grounding.

tool_choice

You can steer the model toward web search using the structured tool_choice form, for example:
Supported tool_choice.type values for built-in tools are defined in the API schema (including web_search, web_search_preview, and related literals). Strings none, auto, and required behave as usual.

Streaming

Set "stream": true on the same JSON body. The server responds with text/event-stream and events in the OpenAI-style response stream format.

Code examples

Set ORQ_API_KEY (or pass the key explicitly) so the Authorization header resolves.

Non-streaming

Streaming

For cURL streaming, -N disables buffering so SSE lines show up as they arrive. Parse data: lines from the response body the same way you would against OpenAI’s Responses stream.

See also

  • OpenAI-Compatible API: base URL and /responses
  • Reasoning: reasoning for OpenAI models via Responses API; thinking for Anthropic and Google Gemini via Chat Completions
  • Tool Calling: function tools on /chat/completions and /responses