How to Cut LLM Search Costs 98% Like DoorDash (The Savings Weren't in Tokens)
DoorDash cut its LLM search bill by more than 98%, and accuracy went slightly up. It's easy to read that as "DoorDash made its LLM 98% cheaper," and a few Hacker News commenters argued over what the 98% even refers to. I
DoorDash cut its LLM search bill by more than 98%, and accuracy went slightly up. It's easy to read that as "DoorDash made its LLM 98% cheaper," and a few Hacker News commenters argued over what the 98% even refers to. If you're trying to cut LLM API costs on your own project, the answer matters more than the number.
The 98% came from the search tool fees attached to their model calls. Model tokens weren't part of the comparison at all. Their write-up says so plainly: "Reported costs cover search-provider charges and exclude model inference." That's a less comfortable lesson than the one people kept repeating: your invoice probably has a line item you never priced, and it may cost more than the model.
I'll go through what DoorDash built, then the current prices for your own napkin math and the cuts a small team can make this week.
What DoorDash actually built
The workload is query intent understanding (QIU). Someone searches "450 north", an ungrounded model guesses "restaurant", and catalog evidence plus web search show it's a craft brewery, so the query should route to Alcohol. To do that, the model needs web search.
Their baseline was native search, Gemini Flash with Google Search grounding: you switch on the provider's built-in grounding and get one opaque call back. The new system, Decoupled Search Grounding (DSG), moves search into an MCP-compatible gateway in front of Serper, BrightData, Firecrawl, Exa and Tavily. Every query goes through the same steps:
- Normalize the query string.
- Check the exact-match cache.
- Check the semantic cache (embedding similarity).
- Only if both miss, call a provider, with automatic fallback when one times out or errors.
- Normalize results to title, URL and snippet, then write both caches with a TTL set per entry.
- Return a structured tool response and log provider, cache outcome, latency and cost.
The production numbers, with Gemini Flash doing the reasoning and Serper as the DSG search provider:
| Eval set | Native accuracy / cost per 1K | DSG accuracy / cost per 1K |
|---|---|---|
| Retail, general non-food (N=7,988) | 93.40% / $7.90 | 93.90% / $0.110 |
| Tail, synthetic long-tail (N=2,335) | 87.62% / $10.37 | 87.79% / $0.146 |
Between a cold-cache pass and a warm one, the hit rate went from 6.2% to 99.4%. Search cost dropped from $0.7385 to $0.0045 per 1K queries, and average latency went from 4,570 ms to 1,465 ms.
The Hacker News crowd isn't wrong either
The HN thread (227 points) was mostly people arguing about DoorDash the business, but a few technical punches landed. golly_ned's line is the one to remember: "If you optimize something by 10%, you've done something smart. If you optimize something by 50x, you've stopped doing something stupid." sedictious summed the post up as "caching the queries?"
They have a point: a 98% cut mostly shows how expensive the default was. That's exactly why the post is worth reading. Built-in search is a one-flag switch on the Claude, OpenAI and Gemini APIs, so the "stupid" thing is what a lot of teams ship first and never revisit.
DoorDash lists its own caveats, and I found them more interesting than the headline:
- On public QA benchmarks DSG reached 83% to 86% against native search's 87.7%. DoorDash calls that "on par." I'd call it close.
- On FreshQA, which tests recency-sensitive questions, native search beat DSG on all five models they tested (GPT-4o, GPT-4o-mini, Gemini 2.5 Flash, Gemini 2.5 Pro, Claude Sonnet 4).
- On multi-hop questions (HotpotQA), either kind of search gave only modest gains.
On HN, spillguard raised the obvious semantic cache problem: "pizza open now" and "pizza" "are basically the same embedding and definitely not the same answer." The post's answer is short TTLs for recency-sensitive queries, which helps, but you still need to set a similarity threshold you trust.
Step 1: price the web search fees you're not looking at
These are the current built-in search prices. Model tokens are billed on top.
| Search option | Price per 1,000 |
|---|---|
| Claude web search tool | $10 searches + tokens for results |
| OpenAI web search tool | $10 calls + content tokens at model rates |
| Gemini grounding (Gemini 3+) | $14 queries after 5,000 free/month (paid tier) |
| Serper (plan dependent) | $0.30 to $1.00 queries |
At 1M searches a month, the Claude or OpenAI tool comes to $10,000 in search fees alone. The same million queries through Serper costs $300 to $1,000, and that's before any cache hit. On HotpotQA, DoorDash found that Claude Sonnet 4 with native search broke an "answer only" instruction 78.1% of the time by opening with explanatory framing. If your pipeline parses JSON, every one of those is a retry you also pay for.
If you use a built-in search tool, log the number of searches per request today. Gemini bills each search query a request fires, not each prompt, so one call can cost several searches.
Step 2: move classification to a cheaper model
DoorDash ran its QIU evaluation on Gemini Flash, not Pro. Most "is this query about X" tasks don't need the top tier, and the price gaps are absurd:
| Model | Input / output per MTok | Batch in / out |
|---|---|---|
| Claude Opus 5.5 | $4 / $20 | $2 / $10 |
| Claude Sonnet 5.5 | $2 / $10 | $1 / $5 |
| Claude Haiku 5.5 (β€100K prompt) | $0.10 / $0.50 | $0.05 / $0.25 |
| gpt-6.2-astra | $8 / $40 | $4 / $20 |
| gpt-6.1-terra | $1 / $5 | $0.50 / $2.50 |
| gpt-6-luna | $0.10 / $0.50 | $0.05 / $0.25 |
| gpt-oss-120B (Together) | $0.15 / $0.60 | n/a |
Napkin math for a classifier with 1,500 input tokens and 50 output tokens, run 1M times a month:
- Sonnet 5.5: $3,000 input + $500 output = $3,500
- Haiku 5.5: $150 + $25 = $175
- Haiku 5.5 via Batch: $87.50
Do the cheap version properly: build an eval set from real traffic (DoorDash used 7,988 retail queries), run the small model on it, and send only the low-confidence cases to the expensive one. That's routing, and you don't need a router product for it.
Step 3: cache prompts and tool results
Prompt caching is the easy one. Put the static system prompt and few-shot examples first and the variable part last. Cache reads cost 0.1x input on most Claude models and 0.05x on Sonnet 5.5 and Opus 5.5. If 1,200 of the 1,500 tokens above are a shared prefix, Sonnet 5.5 drops from $3,500 to about $1,220 a month, before cache-write charges.
Response and tool caching is where DoorDash's numbers come from. Start with exact match on a normalized key, since it has no false positives. Add semantic caching only when you have an eval set to tune the threshold, and set TTLs by how quickly the answer goes stale.
Step 4: use the Batch API for anything not user-facing
Anthropic and OpenAI both charge 50% less for batch jobs, and Anthropic says batch and caching discounts stack. Nightly enrichment, backfills, eval runs and catalog tagging should never go through the synchronous endpoint.
Step 5: tune how many search results you send
On SimpleQA, going from 2 to 6 search results raised DoorDash's average accuracy from 78.7% to 84.9%. Going to 10 added only 0.6 points. Every extra snippet is input tokens you pay for, so measure where the curve flattens and set the depth there.
The checklist
- Log cost per request split into model tokens and tool fees.
- Replace built-in web search with a search API behind your own cache where freshness allows.
- Run your eval set on a model one or two tiers down.
- Move static prompt content to the front and turn on prompt caching.
- Send offline jobs through the Batch API.
DoorDash's own takeaway was modest: "the durable result is the interface, not the price point." I agree. For me the most useful part is the per-request cost logging, because you can't cut a cost you can't see.
So what's your monthly LLM bill, and what single change cut it the most? I'd especially like to hear from anyone who tried semantic caching in production and pulled it back out.
Sources
- How DoorDash Reduced LLM Search Costs by 98% Without Losing Accuracy (DoorDash Engineering, Oct 29, 2026)
- Hacker News discussion
- Claude API pricing
- OpenAI API pricing
- Gemini API pricing
- Together AI pricing
- Serper
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.