To reduce LLM API costs, start by finding out where the tokens go. Most bills are driven by a few things that repeat on every request, such as a long system prompt, a growing chat history or answers that run longer than anyone needs. This guide goes through seven changes in the order we'd try them, from the safest to the ones that need testing. Each one comes with a worked example using list prices we checked on 25 November 2026. Prices change often, so treat the sums as a method and run your own numbers before deciding.

Where does the money go?

An API bill has three parts. Input tokens are what you send, cached input tokens are repeated text the provider has kept, and output tokens are what the model writes. Their prices are far apart.

Model Input Cached input Output
Claude Sonnet 5.5 $2.00 $0.10 $10.00
GPT-6.2 Sol $2.00 $0.10 $10.00
GPT-6.1 Terra $1.00 $0.05 $5.00
GPT-6 Luna $0.10 $0.01 $0.50
Claude Haiku 5.5, up to 100,000 tokens $0.10 $0.01 $0.50

All prices are per million tokens. Two patterns stand out. Output costs five times as much as input on every row. Cached input costs 10% of the normal price on the small models and 5% on the larger ones.

So the first job is to look at a typical request and count each part. Paste your system prompt and an average reply into the AI token counter, then put the numbers into the LLM cost calculator.

Steps 1 and 2, shorten what you write and read

Step 1 is to cap the output. Ask for the length you need and set a maximum in the request. If replies average 800 tokens and people only read the first 300, you're paying for 500 tokens that nobody wants. On Claude Sonnet 5.5, cutting 500 output tokens from 100,000 requests saves 50 million tokens, or $500.

Be specific in the prompt. "Answer in two sentences" works better than "be brief". For structured data, ask for only the fields your code uses.

Step 2 is to trim the input. Read your system prompt line by line and remove rules the model already follows, repeated examples and anything left over from old features. Then look at what your code adds. Long tool descriptions, full user profiles and search results that are never used are common.

Structured data deserves its own check. JSON repeats every key in every record. The JSON token counter shows which branches take the most room, so you can drop fields before shortening names.

Step 3, how much does prompt caching save?

Caching is the biggest saving for apps that send the same long text every time. The provider keeps the repeated beginning of your prompt, and later requests pay a much lower price for it.

Here's a support assistant with a 6,000 token system prompt, 1,000 tokens of new text and 400 tokens of output, on Claude Sonnet 5.5.

Part No cache With cache hits
System prompt, 6,000 tokens $0.0120 $0.0006
New input, 1,000 tokens $0.0020 $0.0020
Output, 400 tokens $0.0040 $0.0040
One request $0.0180 $0.0066
100,000 requests $1,800 $660

That's 63% lower, with the same model and the same answers. Real savings are smaller, because writing to the cache costs extra and entries expire. On Claude Sonnet 5.5, a five minute cache write costs $2.50 per million tokens against $2.00 for normal input, so the cache has to be read soon after it's written to pay off.

Order matters. Caching works from the start of the prompt, so put the fixed text first and the part that changes last. A timestamp or user name at the top can prevent every later token from matching.

Step 4, when is a smaller model enough?

Not every request needs your best model. Sorting messages, pulling out names and dates, or rewriting short text often works on a small one.

Job on 100,000 requests, 1,500 in and 200 out Cost
Claude Sonnet 5.5 or GPT-6.2 Sol $500
GPT-6.1 Terra $250
GPT-6 Luna or Claude Haiku 5.5 $25

The gap is twenty times between the top and bottom rows. Before switching, collect fifty real requests and compare the answers. If the small model gets 45 right, you may be able to send the other five to a larger model and still pay a fraction.

Don't forget the cost of mistakes. A wrong answer that a person has to fix can cost more than a thousand requests.

Steps 5 and 6, batch what can wait and watch the thresholds

Step 5 is to batch jobs that nobody is waiting for. Overnight summaries, tagging and evaluations don't need an instant reply. Anthropic's pricing page lists batch requests at half price for the models above, so Claude Sonnet 5.5 drops to $1 for input and $5 for output. DeepSeek charges half as much outside its weekday peak hours, so the clock can save money there too.

Step 6 is to stay under price thresholds. Some models charge more once a prompt passes a certain length, and the higher price can apply to the whole request. Claude Haiku 5.5 costs five times as much per token above 100,000 input tokens. Several OpenAI models cost more above 272,000. If you're a little over a line, trimming a document can cut the bill sharply.

Dates matter too. Google lists Gemini 4 Argon at $2 for input until 30 November 2026 and $4 after that. Put announced changes in your calendar so they don't arrive as a surprise.

Step 7, measure, limit and repeat

Savings fade unless someone watches. A new feature adds a tool, a prompt gains three paragraphs, and six months later the bill is back where it began.

  • Log input, cached and output tokens for every request, with the feature that made it.
  • Look at cost per successful task and not cost per request.
  • Set a spending alert and a hard limit in the provider's console.
  • Cap the length of chat history, or summarize old turns.
  • Stop runaway loops by limiting how many calls one task can make.
  • Review the five most expensive prompts every month.

If you do only one thing this week, log the tokens. Nearly every saving in this guide becomes obvious once you can see which requests are large and what they contain. Start with caching if your system prompt is long, and with output limits if your replies are.