---
title: "OpenAI Web Search API Pricing (2026): Cost per 1,000"
description: "OpenAI's web search tool costs $10 per 1,000 calls plus search content tokens at model rates, or $25 per 1,000 on the preview tool for non-reasoning models. The real cost per 1,000 searches by model, how to call it, its limits, and how it compares with Claude, Gemini and search APIs."
category: "pricing"
url: https://keirolabs.cloud/blog/openai-web-search-api-pricing
published: 2026-12-02
updated: 2026-12-02
---

# OpenAI web search API pricing (2026): cost per 1,000 calls, tokens included

## The 60-second version

**OpenAI's web search tool costs $10 per 1,000 calls, plus the search content tokens the model reads, billed at that model's normal input rate.** The older `web_search_preview` tool on non-reasoning models costs $25 per 1,000 calls with content tokens free. On `gpt-4o-mini` and `gpt-4.1-mini`, content is billed as a fixed block of 8,000 input tokens per call ([OpenAI pricing](https://developers.openai.com/api/docs/pricing), checked December 2, 2026).

- **Real cost on a small model:** about **$11 to $13 per 1,000 searches** once the 8,000-token block is added, before the answer's output tokens.
- **Real cost on a flagship model:** $20 to $50 per 1,000 if each search pulls in a similar 8,000 tokens, depending on the model.
- **Bring your own search:** a third-party search API called through function calling costs **$0.03 to $8 per 1,000** for the search itself, plus whatever tokens you choose to pass in.

**Built-in search is the easy path; a search API is the cheap and controllable one.**

## What does web search cost per 1,000 calls across providers?

| Option | Per 1,000 searches | What else you pay |
|---|---|---|
| [OpenAI `web_search`](https://developers.openai.com/api/docs/pricing) | $10 | Search content tokens at model rates (fixed 8,000-token block on the two mini models) |
| [OpenAI `web_search_preview`](https://developers.openai.com/api/docs/pricing), non-reasoning models | $25 | Content tokens free |
| [Claude web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool) | $10 | Results billed as input tokens, in this and later turns |
| [Gemini grounding with Google Search](https://aistudio.google.com/docs/pricing) (Gemini 3 and newer) | $14 after 5,000 free a month | Model tokens |
| **Keirolabs lite** | **$0.03 to $0.10** on a plan ($0.23 to $0.30 on credit packs) | Tokens for the results you pass in |
| **Keirolabs /search** | $0.44 to $1.33 | Same |
| **Keirolabs answer** (cited answer) | $0.89 to $2.67 | None; the answer is written for you |
| **Keirolabs search plus content** | $1.33 to $4.00 (up to 5 full pages) | Tokens for the page text you pass in |
| [Brave Search](https://api-dashboard.search.brave.com/documentation/pricing) | $5 | Tokens you pass in |
| [Exa](https://exa.ai/pricing) | $7 (auto, fast), $4 (lite) | Contents $1 per 1,000 pages |
| [Tavily](https://docs.tavily.com/documentation/api-credits) | $8 basic, $16 advanced (pay as you go) | Tokens you pass in |

Disclosure: Keirolabs is ours ([pricing](https://keirolabs.cloud/pricing)). The built-in tools also do the reading, choosing and citing for you, so the comparison is not exactly like for like. The point is the size of the gap: **on the cheapest search APIs, the search call alone costs a hundredth of OpenAI's $10 fee or less.**

## What does OpenAI web search really cost once tokens are added?

**The $10 is only the call fee.** Every call also feeds search results into the model, and you pay for those tokens. OpenAI fixes that block at 8,000 input tokens per call on `gpt-4o-mini` and `gpt-4.1-mini`; on other models it varies with what the search returns. Using 8,000 tokens as a working figure for every model:

| Model | Input price per 1M tokens | Content tokens per 1,000 calls | Total per 1,000 searches |
|---|---|---|---|
| gpt-4o-mini | $0.15 | $1.20 | **$11.20** |
| gpt-4.1-mini | $0.40 | $3.20 | **$13.20** |
| gpt-5.6-luna | $0.20 | $1.60 | about $11.60 |
| gpt-5-mini | $0.25 | $2.00 | about $12.00 |
| gpt-5 | $1.25 | $10.00 | about $20.00 |
| gpt-5.6-sol | $5.00 | $40.00 | about $50.00 |

Token prices from [OpenAI's pricing page](https://developers.openai.com/api/docs/pricing). The two mini rows are exact; the rest assume 8,000 tokens a call, which is an illustration, not a quote. Then add output tokens for the answer itself.

Two things push the real number higher:

- **Reasoning models search more than once.** A multi-step question can trigger several `web_search_call` items in one response, and each is a billed call.
- **`search_context_size: "high"`** gives the model more search context, which means more tokens. The default is `"medium"`; `"low"` is cheaper.

## How do you use OpenAI's web search tool?

In the Responses API, add `{"type": "web_search"}` to `tools`:

```python
from openai import OpenAI

client = OpenAI()
resp = client.responses.create(
    model="gpt-5-mini",
    tools=[{
        "type": "web_search",
        "search_context_size": "low",                       # fewer content tokens
        "filters": {"allowed_domains": ["firecrawl.dev", "docs.firecrawl.dev"]},
    }],
    include=["web_search_call.action.sources"],             # every URL consulted
    input="What does Firecrawl's Standard plan cost per month?",
)
print(resp.output_text)
```

What OpenAI's [web search guide](https://developers.openai.com/api/docs/guides/tools-web-search) documents:

- **Domain filters:** up to 100 `allowed_domains` or 100 `blocked_domains`.
- **Location:** `user_location` with an approximate country, city, region and timezone.
- **Citations:** inline `url_citation` annotations; the `include` flag lists every source consulted, which is usually longer than the cited list.
- **Context cap:** the web search context window is limited to 128k tokens, even on models with larger windows.
- **Chat Completions:** only `gpt-5-search-api` supports search there; the `gpt-4o` search preview models shut down on July 23, 2026.
- **Forcing a search:** with `tool_choice: "auto"` searching is optional; use `"required"` to force it.

## What are the limits of built-in search?

- **You do not get a raw result list.** You get the model's answer and its citations. If you want to rank, dedupe, cache or log results yourself, the built-in tool gets in the way.
- **You do not control the token bill.** The model decides how much search content to read, within the context size you pick.
- **Latency adds up.** The model searches, reads and writes in one turn; reasoning models with several searches can take a while, and OpenAI suggests background mode for long runs.
- **It is tied to one provider.** Switching models means switching search tools and their billing.

## How do you bring your own search with function calling?

**Define a `web_search` function, run the search yourself, and pass back only what the model needs.** Here the search is a Keirolabs lite call at $0.03 to $0.10 per 1,000:

```python
import json, os, requests
from openai import OpenAI

client = OpenAI()

def keiro_search(query: str) -> str:
    r = requests.post("https://api.keirolabs.cloud/api/v2/search/lite",
                      headers={"Authorization": f"Bearer {os.environ['KEIRO_API_KEY']}",
                               "Content-Type": "application/json"},
                      json={"query": query, "count": 8}, timeout=30)
    r.raise_for_status()
    return "\n\n".join(f"[{i+1}] {x['title']}\n{x['url']}\n{x.get('snippet', '')}"
                       for i, x in enumerate(r.json()["results"]))

tools = [{
    "type": "function",
    "name": "web_search",
    "description": "Search the web. Returns titles, URLs and snippets.",
    "parameters": {"type": "object", "properties": {"query": {"type": "string"}},
                   "required": ["query"], "additionalProperties": False},
}]

inputs = [{"role": "user", "content": "What does Firecrawl's Standard plan cost? Cite sources."}]
resp = client.responses.create(model="gpt-5-mini", input=inputs, tools=tools)
for _ in range(4):                                   # cap the loop
    calls = [o for o in resp.output if o.type == "function_call"]
    if not calls:
        break
    inputs += resp.output
    for c in calls:
        q = json.loads(c.arguments)["query"]
        inputs.append({"type": "function_call_output", "call_id": c.call_id, "output": keiro_search(q)})
    resp = client.responses.create(model="gpt-5-mini", input=inputs, tools=tools)

print(resp.output_text)
```

Eight snippets are roughly 1,000 to 1,500 tokens, so on `gpt-5-mini` a search costs about $0.03 to $0.10 per 1,000 for the call plus about $0.25 to $0.38 per 1,000 in input tokens. When snippets are not enough, swap the endpoint for `/api/v2/search/content` ($1.33 to $4.00 per 1,000) and pass in trimmed page text, or `/api/v2/extract` for a URL you already have. New accounts get **2,000 free credits (1,000 at signup plus 1,000 after setup)**, no card.

## When should you use each?

| If you... | Use |
|---|---|
| Want the fewest lines of code and already use OpenAI | Built-in `web_search` |
| Run a non-reasoning model and want a flat fee | `web_search_preview` at $25 per 1,000, tokens free |
| Need cheap, high-volume search | A search API through function calling |
| Want to cache, rank or log results | A search API |
| Switch between OpenAI, Claude and open models | A search API, so search stays the same when the model changes |
| Want a cited answer without running a model loop | A search API with an answer endpoint |

More on the trade-offs in [LLM web search APIs](/blog/llm-web-search-api), the Claude equivalent in [Claude's web search tool](/blog/claude-web-search-tool), and the function-calling pattern in depth in [LLM web search tool calling](/blog/llm-web-search-tool-calling).
