How to lower your Claude API costs
How to reduce Claude API costs: trim prompts, cap output, use the Batch API at half price, and test a cheaper model on your own data before you switch.
Updated
To reduce Claude API costs, send fewer tokens, ask for fewer back, and move any work that can wait to the Batch API, which bills at half price. Most of the savings come from calls you already make, before you change models. Switching to a cheaper model is the last step, and only after a test on your own data.
Find the calls that cost the most
Start with the calls, not the total. Your invoice shows spend by model and API key, which rarely matches how your product is built. One user action can trigger three or four Claude calls, and a retry loop can quietly repeat the most expensive one. Agents multiply this, because each agent step re-sends the context. For each call, write down the task, how often it runs, and the input and output tokens it uses. Sort by the product of those numbers. The top two or three rows usually decide where your effort goes. The LLM cost calculator can turn token counts into a monthly estimate. For list prices by tier, see how to estimate your monthly Claude bill.
The free AI cost audit does this step from your code. It reads the repository as text on your machine, makes no network calls while it reads, uploads nothing, and saves a PDF listing your AI calls, models, estimated cost and common problems. The tool is open source under the MIT license, so your engineers can read what it does before running it.
Shorten what you send
Long prompts cost money on every call. The usual sources of waste are:
- Instructions left over from earlier versions of the feature. Ask which lines the current output actually depends on.
- Examples that repeat one pattern. Two examples that show the same thing usually do the work of one.
- Whole records where the task needs three fields. An invoice intake call that needs the vendor name, total and due date does not need the line items.
- Retrieved passages that only loosely match the question.
- Retries that resend the full prompt after a timeout. Log how often they fire.
Prompt caching helps when the same long prefix goes out on every call, such as a fixed system prompt or a standard contract template. The cached part is billed at a lower rate after the first write. Keep stable text first and changing text last, or the cache rarely hits. See prompt caching for when it does not help.
Cap and shape the output
At list price, output tokens cost five times as much as input tokens for both Claude Opus and Claude Haiku, so output is often the cheapest place to save. Set a maximum output length for each call, and ask for a fixed format. A JSON object with three keys costs far less than a paragraph of explanation. If the code only reads a label, ask for the label and nothing else.
A hard cap can cut an answer off mid-field. Check for truncated output and treat it as a failed call, not a valid result, or the cap will quietly corrupt your data.
Reasoning tokens bill as output too, so a call that thinks longer costs more even when the answer looks the same. Reasoning tokens covers how to budget for them.
Move work that can wait to the Batch API
The Batch API is half price. It suits work where nobody waits on the answer: nightly contract reviews, backfills of old invoices, bulk tagging of support tickets. Move those calls first, because the discount applies to every token they use. Keep real-time calls for the steps a user is waiting on, such as one answer shown in your app. Check Anthropic’s documentation for current turnaround times before you move a workload.
The common mistake is batching a step whose output feeds a real-time step. The user then waits on a job built for overnight. Split the workflow so only the independent parts are batched. Batch APIs vs real-time calls covers where the discount is worth the delay.
Test a smaller model on your own data
A cheaper Claude model is the quickest cut, but it can cost accuracy, and the drop differs by task. A smaller model may match a larger one on short labels and fall behind on long documents or exact quotes, so the only number that counts is its score on your own inputs.
Score the current model and each cheaper candidate on the same real inputs, scans and long files included, and switch only the calls that clear an accuracy floor you set before the run. The full method is in how to build a test set.
Trade-offs depend on the task. If you trim a contract to the sections most likely to hold a clause, measure how often the trim drops a clause the full text would have found. Cutting input saves money only while accuracy holds.
When a trained model is the cheaper route
A trained model fits one high-volume task that you now send to a frontier API. It has to pass the same test as a cheaper Claude model: the floor you set, on the same inputs.
Four steps make the change. Audit maps your AI spend by task, for free. Evaluate builds a test from your real data and scores the current model first. Train produces a model that must beat the current model on that test before it goes live. Serve runs it in your cloud account or on your premises. You own the weights. The Own Weights homepage has more on how this works.
The trade-off is that you pay for compute instead of per token, so the saving holds only while that compute stays busy. Throughput matters for bulk work, so compare options by the speed the task needs, not by the headline number.
If most of your Claude bill comes from one task, book a free audit. We will map your AI spend by task from your code and invoices, then tell you plainly whether a trained model is worth testing.
Questions
What is the fastest way to reduce Claude API costs?
Find the few calls that account for most of your spend, then shorten their prompts and cap their output length. Those two changes need no new infrastructure and show up on the next invoice.
Is Claude Haiku cheaper than Claude Opus for every task?
Haiku is far cheaper per token, but cheaper does not mean good enough for your job. A model that is good enough for one task can fall short on another, so check each candidate on a test built from your own data.
Does the Batch API cut Claude costs enough to matter?
Anthropic's Batch API is half price, so any work that can wait for results gets the discount on every token. Confirm current turnaround times and limits in Anthropic's documentation before you move a workload.