Cutting LLM API Costs: Context Caching, Off-Peak Calls and Batch APIs
First, Read the Bill: Where the Money Goes
An LLM API bill has a simple structure: input tokens, output tokens, and whether the input hit the cache. The biggest cost for most teams is not raw conversation volume but repeated prefixes — system prompts, retrieved documents, and few-shot examples shipped to the model again and again. The first step to saving money is not switching models; it is reading your bill to see the input/output split and how much of your input is cacheable repetition.
Lever One: Context Caching
Take DeepSeek as an example. Context caching is automatic on the server side and needs no configuration: when a request's prefix matches recent requests on the same account, the hit portion is billed at cache rates. Under the official September pricing update, deepseek-flash cache-hit input is as low as $0.003 per million tokens off-peak versus $0.15 for a cache miss — roughly a fifty-fold gap. Output is unaffected by caching: $0.60 off-peak, $1.20 at peak. Placing fixed content such as system prompts and knowledge-base documents at the start of the prompt is the key to raising hit rates; details in our context caching explainer.
Lever Two: Off-Peak Calls
Off-peak half pricing is written into the official rate card: during early-morning UTC windows on weekdays (exact hours per official docs), prices are halved. For queueable work — batch summarization, offline evaluation, overnight data cleaning — moving scheduling into the valley cuts model-side costs in half. No business-code changes are required; control send times at the task-queue layer. If valley-hour concurrency might trip rate limits, read our rate limits overview first.
Lever Three: Batch APIs
Major platforms offer batch interfaces that trade non-real-time delivery (results within 24 hours) for a discount; OpenAI and others price batch calls at roughly half of real-time (per documentation as of publication). Batch and off-peak stack: submit batch jobs into valley hours for the cheapest combination on paper. Note that Batch does not fit interactive scenarios, and whether endpoints requiring web retrieval support batching depends on the platform.
A Practical Combination
Back to real scenarios: support chatbots are "high-repeat input, real-time response" — prioritize cache hits and prompt-structure optimization. Report summarization is offline — use Batch plus valley-hour submission. During development, start with a small prepaid balance to cap exposure; our free-tier guide and the September pricing table are good starting references. Prices above reflect DeepSeek's official pages as of publication; verify against current docs before calling. This article is compiled from publicly available materials.
大模型网摘