Two paths to web search through ClearMaas:Documentation Index
Fetch the complete documentation index at: https://docs.clearmaas.com/llms.txt
Use this file to discover all available pages before exploring further.
- Search-preview models — call a search variant directly via
/v1/chat/completions - Tools / options on a regular model — pass
web_search_options(Chat) ortools: [{"type": "web_search"}](Responses)
Search-preview models (OpenAI)
OpenAI publishes search-preview variants for several models — for exampleopenai/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.
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:| Provider | Web search | How |
|---|---|---|
| OpenAI | Yes | Search-preview models, or pass web_search tool to /v1/responses |
| xAI Grok | Yes | Call /v1/responses with tools: [{"type": "web_search"}] and any Grok model — xAI’s Agent Tools API. (xAI deprecated the legacy search_parameters on chat completions on 2026-01-12; the old *-search model-name variants no longer work.) |
| Anthropic | Yes | Pass web_search_options on a Chat Completions request — translated to Anthropic’s native web_search server-tool. search_context_size (low/medium/high) maps to max_uses; user_location.approximate maps to Anthropic’s user_location. |
| Gemini | Yes | Pass a function tool named googleSearch (see below) — translated to Gemini’s native GoogleSearch grounding tool. |
| DeepSeek | No | DeepSeek API does not expose web search. |
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:
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 toolurlContext— 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.