Skip to main content
Two paths to web search through ClearMaas:
  1. Search-preview models �?call a search variant directly via /v1/chat/completions
  2. Tools / options on a regular model �?pass web_search_options (Chat) or tools: [{"type": "web_search"}] (Responses)

Search-preview models (OpenAI)

OpenAI publishes search-preview variants for several models �?for example openai/gpt-4o-search-preview and openai/gpt-5-search-api. Pick one of these as model on /v1/chat/completions and the upstream handles search server-side. Call /v1/models for the live catalog.

web_search_options (Chat Completions)

search_context_size: low / medium / high. Controls search depth (per-call price for web_search is the same regardless of size).

Tools (Responses API)

/v1/responses accepts tools: [{"type": "web_search"}] on both OpenAI models and any Grok model �?xAI’s Agent Tools surface lives at the same endpoint.
Each web_search_call the upstream emits is counted for billing �?see Operations / Billing & Usage.

Cross-provider support

Web search reaches every provider that exposes it; only the entry point differs:

Gemini grounding via googleSearch

For Gemini models, ClearMaas’s translation layer recognizes a magic function name googleSearch and turns it into Gemini’s native GoogleSearch grounding tool. Send it like any other OpenAI-style function tool:
The grounding metadata Gemini returns (webSearchQueries, etc.) is captured by the gateway for billing and surfaced through standard chat-completion fields. Two related magic function names are recognized on the same code path:
  • codeExecution �?enables Gemini’s native code-execution tool
  • urlContext �?enables Gemini’s URL-context tool

Or go native

If you’re already on Gemini’s native protocol via /v1beta/, pass googleSearch directly in Gemini shape �?no magic-name translation needed:
{"codeExecution": {}} and {"urlContext": {}} work the same way on the native path. See Native Formats / Gemini.

Billing

web_search and web_search_preview are tracked as built-in tool calls. They have different pricing tiers �?see Operations / Billing & Usage for the breakdown.