Home / News / AI agent tool costs

The hidden costs of AI agents: web search, file search and code containers

An agent that searches the web or reads your files pays twice: once for each tool call and again for the tokens the results add to the prompt. At scale, tool fees can rival the model bill.

$10Per 1,000 web searches
$2.50Per 1,000 file searches
$0.10Per GB-day of file storage
$0.03Per 20-min 1 GB code container

Published Dec 6, 2026 · Prices checked against official pages · Sources at the end

OpenAI's tool prices

ToolDetailsPrice
Web searchIncluding images; search content tokens billed at model rates$10.00 / 1,000 calls
Web search preview (reasoning models)Search content tokens billed at model rates$10.00 / 1,000 calls
Web search preview (other models)Search content tokens are free$25.00 / 1,000 calls
File search: tool callResponses API only$2.50 / 1,000 calls
File search: storageFirst 1 GB free$0.10 / GB per day
Hosted Shell and Code Interpreter1 GB container, per 20-minute session$0.03
4 GB container$0.12
16 GB container$0.48
64 GB container$1.92
Agent Kit (ChatKit) uploadsFile and image storage, first 1 GB free per month$0.10 / GB-day

Tokens used by built-in tools are billed at the chosen model's per-token rates. Storage “GB” means binary gigabytes (2^30 bytes). Eligible container sessions are billed by the minute with a 5-minute minimum.

The second charge: tokens

A web search returns content that is fed to the model with your prompt, and on most search options those “search content tokens” are billed at the model's normal input rate. A search that pulls in several thousand tokens of results on a flagship model can cost more in tokens than the $0.01 call fee. The exception is web search preview for non-reasoning models, which charges more per call ($25 per 1,000) but does not bill the search content tokens.

A worked example

A research agent runs 2,000 tasks a day. Each task makes 3 web searches and 2 file-search calls, and the agent keeps 10 GB of documents in file search. Over a 30-day month, before any token costs:

ItemPer month
Web search calls (180,000)$1,800
File search calls (120,000)$300
File storage (9 GB above the free 1 GB)$27
Total tool fees$2,127

Add the tokens those searches bring back, and the agent's tool-related cost can exceed what the same workload would pay for the model alone. Use the API calculator for the token side.

How to keep tool costs down

  • Search less often. Cache search results for repeated questions instead of searching every time.
  • Limit what comes back. Fewer, shorter results mean fewer search content tokens.
  • Prune stored files. Storage is billed every day; delete documents the agent no longer needs.
  • Right-size containers. A 64 GB container costs 64× a 1 GB one per session.

Sources