Orq MCP is live: Use natural language to interrogate traces, spot regressions, and experiment your way to optimal AI configurations. Available in Claude Desktop, Claude Code, Cursor, and more. Start now →
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 AI Gateway forwards search to each provider’s native capability when the model supports it.There is no separate Perplexity or Parallel tool in the AI Gateway; the supported contract is OpenAI-styleweb_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 the workspace model list.
Use the OpenAI SDK against the AI Gateway base URL and call the Responses API directly.
curl -sS -X POST "https://api.orq.ai/v3/router/responses" \ -H "Authorization: Bearer ${ORQ_API_KEY}" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/o3", "input": "What are the latest changes to the OpenAI Responses API?", "tools": [{ "type": "web_search_preview" }] }'
import OpenAI from "openai";const client = new OpenAI({ apiKey: process.env.ORQ_API_KEY, baseURL: "https://api.orq.ai/v3/router",});const response = await client.responses.create({ model: "openai/o3", input: "What are the latest changes to the OpenAI Responses API?", tools: [{ type: "web_search_preview" }],});console.log(response.output_text);
from openai import OpenAIimport osclient = OpenAI( api_key=os.environ.get("ORQ_API_KEY"), base_url="https://api.orq.ai/v3/router",)response = client.responses.create( model="openai/o3", input="What are the latest changes to the OpenAI Responses API?", tools=[{"type": "web_search_preview"}],)print(response.output_text)
Optional. e.g. allowed_domains (nullable array) to restrict domains.
The AI Gateway 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.
Tools and include are passed to client.responses.create with the 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.
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.
Set "stream": true on the same JSON body. The server responds with text/event-stream and events in the OpenAI-style response stream format.
curl -sS -N -X POST "https://api.orq.ai/v3/router/responses" \ -H "Authorization: Bearer ${ORQ_API_KEY}" \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{ "model": "openai/o3", "input": "What is the current phase of the moon for San Francisco?", "tools": [{ "type": "web_search_preview" }], "stream": true }'
import OpenAI from "openai";const client = new OpenAI({ apiKey: process.env.ORQ_API_KEY, baseURL: "https://api.orq.ai/v3/router",});const stream = await client.responses.create({ model: "openai/o3", input: "What is the current phase of the moon for San Francisco?", tools: [{ type: "web_search_preview" }], stream: true,});for await (const event of stream) { console.log(event);}
from openai import OpenAIimport osclient = OpenAI( api_key=os.environ.get("ORQ_API_KEY"), base_url="https://api.orq.ai/v3/router",)stream = client.responses.create( model="openai/o3", input="What is the current phase of the moon for San Francisco?", tools=[{"type": "web_search_preview"}], stream=True,)for event in stream: print(event)
curl -sS -X POST "https://api.orq.ai/v3/router/responses" \ -H "Authorization: Bearer ${ORQ_API_KEY}" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/o3", "input": "What is the current phase of the moon for San Francisco?", "tools": [{ "type": "web_search_preview" }], "include": ["web_search_call.action.sources"] }'
import OpenAI from "openai";const client = new OpenAI({ apiKey: process.env.ORQ_API_KEY, baseURL: "https://api.orq.ai/v3/router",});const response = await client.responses.create({ model: "openai/o3", input: "What is the current phase of the moon for San Francisco?", tools: [{ type: "web_search_preview" }], include: ["web_search_call.action.sources"],});console.log(response.output_text);for (const item of response.output ?? []) { if (item.type === "web_search_call") { console.log("web_search_call", item.action); }}
from openai import OpenAIimport osclient = OpenAI( api_key=os.environ.get("ORQ_API_KEY"), base_url="https://api.orq.ai/v3/router",)response = client.responses.create( model="openai/o3", input="What is the current phase of the moon for San Francisco?", tools=[{"type": "web_search_preview"}], include=["web_search_call.action.sources"],)print(response.output_text)for item in response.output or []: if item.type == "web_search_call": print("web_search_call", item.action)
curl -sS -N -X POST "https://api.orq.ai/v3/router/responses" \ -H "Authorization: Bearer ${ORQ_API_KEY}" \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{ "model": "openai/o3", "input": "What is the current phase of the moon for San Francisco?", "tools": [{ "type": "web_search_preview" }], "stream": true }'
import OpenAI from "openai";const client = new OpenAI({ apiKey: process.env.ORQ_API_KEY, baseURL: "https://api.orq.ai/v3/router",});const stream = await client.responses.create({ model: "openai/o3", input: "What is the current phase of the moon for San Francisco?", tools: [{ type: "web_search_preview" }], stream: true,});for await (const event of stream) { console.log(event);}
from openai import OpenAIimport osclient = OpenAI( api_key=os.environ.get("ORQ_API_KEY"), base_url="https://api.orq.ai/v3/router",)stream = client.responses.create( model="openai/o3", input="What is the current phase of the moon for San Francisco?", tools=[{"type": "web_search_preview"}], stream=True,)for event in stream: print(event)
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.