--- title: "Web search in LLM APIs: OpenAI vs Claude vs Gemini vs Ollama (2026)" category: "comparisons" url: https://keirolabs.cloud/blog/llm-web-search-api --- ## The 60-second version **OpenAI, Anthropic and Google all sell built-in web search as a tool their models call, at $10 to $35 per 1,000 searches plus the tokens the results add.** Ollama offers a web search API with a free account. A standalone search API costs $0.25 to $8 per 1,000 and works with every model. | Provider | Built-in search price | Free allowance | Results billed as tokens? | |---|---|---|---| | OpenAI (web search tool) | $10 per 1,000 calls | — | Yes, at the model's rates | | OpenAI (web search preview, non-reasoning models) | $25 per 1,000 calls | — | No, content tokens free | | Anthropic Claude (web search tool) | $10 per 1,000 searches | — | Yes, as input tokens | | Google Gemini 3 (grounding with Google Search) | $14 per 1,000 search queries | 5,000 a month | Yes | | Google Gemini 2.5 (grounding) | $35 per 1,000 grounded prompts | 1,500 a day | Yes | | Ollama (web search API) | Not published | Free account required | n/a (returns text) | Prices were read from [OpenAI's pricing page](https://developers.openai.com/api/docs/pricing), [Anthropic's web search tool docs](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool), [Gemini API pricing](https://ai.google.dev/gemini-api/docs/pricing) and [Ollama's web search docs](https://docs.ollama.com/capabilities/web-search) on October 19, 2026. ## OpenAI web search tool **OpenAI charges $10 per 1,000 web search calls on all models, and the retrieved content is billed as input tokens at the model's rate.** There are two variants: - **Web search** (the current tool): $10 per 1,000 calls, all models. For `gpt-4o-mini` and `gpt-4.1-mini`, the search content is billed as a fixed block of 8,000 input tokens per call. - **Web search preview:** $10 per 1,000 on reasoning models (gpt-5, o-series) with content billed as tokens; **$25 per 1,000 on non-reasoning models, with content tokens free.** Image web search is also $10 per 1,000. **Search content tokens are the real cost driver.** A call that pulls 8,000 tokens of results into a model at a few dollars per million input tokens can cost as much as the search fee itself. ## Claude web search tool **Anthropic charges $10 per 1,000 searches, plus standard token costs for the results, which count as input tokens in that turn and in every later turn of the conversation.** ```json { "type": "web_search_20250305", "name": "web_search", "max_uses": 5, "allowed_domains": ["sec.gov", "investor.nvidia.com"], "user_location": { "type": "approximate", "country": "US" } } ``` - **Controls:** `max_uses` caps searches per request; `allowed_domains` or `blocked_domains` (not both) restrict sources; `user_location` localizes results. - **Citations are always on:** each cited passage carries the URL, title and up to 150 characters of `cited_text`, and those citation fields do not count as tokens. - **Dynamic filtering** (`web_search_20260209` and later, Claude 4.6+): Claude writes code to filter results before they reach the context window, which cuts token use on search-heavy requests. - **Failed searches are not billed,** and one search counts as one use regardless of how many results it returns. - **Availability:** the Claude API, Claude Platform on AWS and Microsoft Foundry. Google Cloud supports only the basic tool, and Amazon Bedrock has no web search. ## Gemini grounding with Google Search **Gemini's search tool is Google itself, and its pricing changed with Gemini 3:** - **Gemini 3 and newer:** 5,000 search requests free per month, shared across all Gemini 3+ models, then **$14 per 1,000 search queries.** You are charged for each search query a request triggers, so one prompt that fans out into three searches bills three. - **Gemini 2.5 Pro, Flash and Flash-Lite:** 1,500 grounded requests free per day (Flash and Flash-Lite share theirs), then **$35 per 1,000 grounded prompts.** Grounding is the only built-in option backed by Google's own index, which matters for local, shopping and very fresh queries. ## Ollama web search API **Ollama runs a hosted web search and web fetch API for local and cloud models. A free Ollama account and an API key are required.** ```bash curl https://ollama.com/api/web_search \ -H "Authorization: Bearer $OLLAMA_API_KEY" \ -d '{"query": "latest MCP spec release", "max_results": 5}' ``` `max_results` defaults to 5 and caps at 10; each result has `title`, `url` and `content`. A companion `web_fetch` endpoint returns a page's title, main content and links. Ollama's docs do not publish usage pricing or rate limits, and they recommend a context window of about 32,000 tokens for search agents because results are long. ## Cost per 1,000 searches, side by side **At 100,000 searches a month, before tokens:** | Option | Search fees at 100k/month | Works with | |---|---|---| | Keirolabs `/search/lite` | $30 (Essential plan covers 125,000) | Any model | | Parallel Search (Turbo) | $100 | Any model | | OpenAI web search | $1,000 | OpenAI models | | Claude web search | $1,000 | Claude models | | Gemini 3 grounding | $1,330 (after 5,000 free) | Gemini models | | Gemini 2.5 grounding | about $1,925 (after 1,500 free a day) | Gemini models | | OpenAI web search preview (non-reasoning) | $2,500 | OpenAI models | Standalone prices come from [Keirolabs pricing](https://keirolabs.cloud/pricing) and our [cost per query comparison](/blog/search-api-cost-per-query-latency). ## When to bring your own search API **Built-in search is the fastest way to ship. A standalone search API wins on four counts once you are past the prototype.** 1. **Cost at volume.** The built-in tools run $10 to $35 per 1,000; a search API runs $0.25 to $8. 2. **Control over the results.** With your own call you choose the results, trim them and cache them before any tokens are spent. Built-in tools put the results into the context for you. 3. **No lock-in.** One search layer serves OpenAI, Claude, Gemini and local models, so switching models does not change your retrieval. 4. **Page content, not snippets.** Agents answer better from full pages. Keirolabs' `/search/content` returns ranked pages with clean text in one call. **Keep built-in search** when you need Google's own index (Gemini grounding), when citation formatting matters more than cost (Claude's citations), or when volume is low enough that $10 per 1,000 is noise. The Keirolabs free tier is 1,250 credits a month with no card. That is 12,500 `/search/lite` searches, enough to run the same eval through every option in this table. For agent-specific trade-offs, see [the best AI search APIs](/blog/web-search-apis-for-agents-2026) and [web search MCP servers](/blog/mcp-model-context-protocol-web-search-2026-guide).