# LLM API Web Search Compared: OpenAI, Gemini, Claude & More
Large language models are only as current as the information they can reach. For developers building chatbots, research agents, and customer-facing tools, **built-in web search at the API level** has become one of the most important features to evaluate when choosing a model provider.
ChatGPT (OpenAI), Gemini (Google), and Claude (Anthropic) now all ship server-side search tools that return real-time content with inline citations. Meanwhile, models like DeepSeek-R1, Doubao, and Qwen sit in a more complicated position—some offering limited public-beta search, others requiring third-party integrations.
This guide breaks down how each major LLM API handles web search, how the billing works, what control parameters you get, and how to pick the right provider for your use case.
## Quick Summary of Built-In Search Support
| Model | Native API Search? | Key Parameter | Pricing Model | Notes |
|—|—|—|—|—|
| **ChatGPT (OpenAI)** | Yes | `web_search_options` / `web_search_preview` tool | Token-based, varies by `search_context_size` | GPT-4o series only; beta phase |
| **Gemini (Google)** | Yes | `tools:[{“google_search”:{}}]` | ~$35 per 1,000 searches, plus tokens | Dynamic retrieval threshold |
| **Claude (Anthropic)** | Yes | `web_search_20250305` tool with `max_uses` | ~$10 per 1,000 searches, plus tokens | Domain filtering, location control |
| **DeepSeek-R1** | Limited beta | `enable_search: true` | No separate search fee (via Quark Search) | Only on Alibaba Cloud LLM API / OpenSearch |
| **Doubao (ByteDance)** | No general API | Ark plugin (bot/workflow level) | 1,000 free plugin requests/day | Ark platform only |
| **Qwen (Alibaba)** | No general API | DashScope web toolchain | N/A | Requires self-built RAG or external SERP API |
## The Three Providers With True Native API Search
### 1. OpenAI (ChatGPT / GPT-4o Series)
OpenAI offers two paths to enable web search through its API:
– **Chat Completions API**: Select a dedicated search model such as `gpt-4o-search-preview` or `gpt-4o-mini-search-preview`, then pass `web_search_options` (including `search_context_size` and `user_location`).
– **Responses API**: Add `{“type”: “web_search_preview”}` to the `tools` array on any compatible model to trigger automatic retrieval when needed.
Citations are returned inline via `url_citation` annotations, each carrying the full source URL. The `search_context_size` parameter lets you trade off quality against cost—lower values retrieve less context and cost less.
**Limitations**: Search is currently limited to the GPT-4o model family and remains in beta, meaning some standard API parameters may not be fully supported.
### 2. Google Gemini
Enabling search in Gemini is as simple as adding Google Search as a tool:
“`python
tools=[{“google_search”: {}}]
“`
This activates **Grounding with Google Search**, where Google handles the query, deduplication, ranking, and source attribution behind the scenes. Results come back with inline source links and search suggestions.
Gemini gives developers fine-grained control through a **dynamic retrieval threshold** (`retrieval_threshold` in the SDK, or `dynamic_retrieval.rerank_threshold` in AI Studio). This threshold determines whether the model actually performs a search or answers from its training data, which helps control costs. You can also mix Google Search with up to 10 additional retrieval sources.
**Pricing**: Google charges approximately **$35 per 1,000 search requests**, with token costs billed separately.
### 3. Anthropic Claude
Claude currently offers the most granular search controls of any provider. You enable search by adding the `web_search_20250305` tool type to the `tools` array and specifying a `max_uses` limit:
“`python
tools=[{
“type”: “web_search_20250305”,
“name”: “web_search”,
“max_uses”: 2,
“allowed_domains”: [“bbc.com”, “reuters.com”]
}]
“`
Claude autonomously decides on search queries, iterates across multiple rounds, and produces answers with mandatory source citations. The advanced controls include:
– **Domain filtering** via `allowed_domains` and `blocked_domains`
– **Geographic targeting** with `user_location`
– **Iteration limits** via `max_uses`—exceeding this triggers a `max_uses_exceeded` error
This makes Claude especially well-suited for applications that need tight control over information sources, such as regulated industries or fact-checked research tools.
**Pricing**: Approximately **$10 per 1,000 searches**, plus standard model token costs. The tool is available across Claude 4 Opus, Claude 3.7 Sonnet, and the Claude 3.5 family.
## Models With Limited or No Native Search
### DeepSeek-R1
DeepSeek-R1 supports an `enable_search: true` parameter, but only when invoked through the **Alibaba Cloud LLM API gateway** or **OpenSearch** scenarios. The backend calls Quark Search, returns summary snippets spliced into the context, and appends short URL references.
This capability is currently in **public beta** and has not been extended to other DeepSeek models (V3, V2, etc.). There is no separate retrieval fee within the Quark Search channel—costs are bundled into the standard token pricing.
### Doubao (ByteDance)
Volcano Engine Ark supports mounting a “web search plugin” at the bot or workflow level. The plugin returns structured JSON with fields like `site_name`, `summary`, and `url`, powered by ByteDance’s internal search stack.
However, Doubao’s **OpenAI-compatible `chat/completions` endpoint does not expose an `enable_search` field**. Developers must use the Ark platform workflow or integrate an external search source themselves.
### Qwen (Alibaba Tongyi Qianwen)
DashScope’s web interface bundles Qwen with search and web-parsing tools, but the **SDK and HTTP API have not yet exposed corresponding parameters**. Developers typically work around this by combining function calling with a Bing or Brave SERP API to retrieve results and feed them back into the context.
## Code Examples
Here are working snippets for the three providers with native search support:
**OpenAI Responses API:**
“`python
from openai import OpenAI
client = OpenAI()
resp = client.responses.create(
model=”gpt-4o”,
tools=[{“type”: “web_search_preview”, “search_context_size”: “low”}],
input=”What is the latest pricing for the GPT-4o model?”
)
print(resp.output_text)
“`
**Gemini with Google Search Grounding:**
“`python
from google import genai
cli = genai.Client()
resp = cli.models.generate_content(
model=”gemini-2.5-flash”,
contents=”Who won the most recent Olympic men’s singles table tennis title?”,
config=genai.types.GenerateContentConfig(
tools=[{“google_search”: {}}],
)
)
print(resp.text)
“`
**Claude 3.7 Sonnet with web search (max 2 queries):**
“`python
import anthropic, os, json
client = anthropic.Anthropic(api_key=os.getenv(“ANTHROPIC_API_KEY”))
msg = client.messages.create(
model=”claude-3-7-sonnet-20250219″,
max_tokens=1024,
tools=[{
“type”: “web_search_20250305”,
“name”: “web_search”,
“max_uses”: 2,
“allowed_domains”: [“bbc.com”, “reuters.com”]
}],
messages=[{“role”: “user”, “content”: “What were the key points of the latest UK base rate decision?”}]
)
print(json.dumps(msg, indent=2))
“`
## How to Choose the Right Provider
Your decision should weigh four factors: **ease of integration, citation transparency, cost, and compliance**.
– **Need official-grade real-time information immediately**: Gemini offers strong global search coverage and quality. Claude provides the finest control over citations and sources. If you’re already in the OpenAI ecosystem, `gpt-4o-search-preview` is the fastest path to production.
– **Building for the Chinese market with compliance requirements**: DeepSeek-R1’s Quark Search channel is the most accessible public-beta option today. Doubao requires the Ark plugin workflow. Qwen is best paired with a self-built RAG pipeline.
– **Need strict source control or hallucination reduction**: Claude’s domain allowlists/blocklists and `max_uses` caps offer the strongest guardrails of any provider.
– **High query volume with tight cost constraints**: Run retrieval on your own backend using a SERP API (Bing, Brave, etc.) plus function calling. This lets any model consume search results while completely avoiding per-search platform fees.
## Risk and Recency Note
LLM API features, pricing, and beta availability change frequently. The search tools described here reflect the state of each provider as of mid-2025. Always verify current documentation before committing to a provider—especially for beta features like OpenAI’s search models, DeepSeek-R1’s Quark integration, and Claude’s `web_search_20250305` tool, all of which may see parameter names, pricing tiers, or supported model lists updated without notice.
## Bottom Line
Truly native, out-of-the-box web search at the API level exists today only in OpenAI’s GPT-4o family, Google Gemini, Anthropic Claude, and the limited DeepSeek-R1 public beta. Everything else—Doubao, Qwen, and other regional models—still requires plugins or external search APIs to achieve the same result. Choose based on your integration depth, citation needs, budget, and regulatory environment, and always keep a fallback plan (self-hosted RAG or function-calling-based retrieval) in case a provider changes its offering.










