Your AI Bill Has Two Dials. You Are Probably Only Turning One.

· Source: LLM on Medium · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cloud Computing & IT Infrastructure · Depth: Intermediate, long

Summary

AI billing for metered API usage is driven by two factors: cost per token and tokens per task. While many teams prioritize reducing cost per token by selecting cheaper models, the article emphasizes that optimizing "tokens per task" offers significantly larger, multiplicative savings. This second dial is controlled by four key levers: compression, retrieval-augmented generation (RAG), caching, and smart routing. For instance, OpenAI provides automatic caching for prompts over 1,024 tokens, offering a 90% discount on cached input reads, while Anthropic offers developer-controlled caching with similar savings. Both providers also offer a 50% discount for asynchronous batch processing. The article clarifies that these optimization strategies apply specifically to pay-as-you-go API models, not flat-fee subscriptions like ChatGPT Plus, where cost optimization focuses on plan selection and seat usage.

Key takeaway

For AI Architects or MLOps Engineers managing LLM API costs, prioritize optimizing "tokens per task" over merely seeking cheaper models. You should measure input/output tokens per task to identify expensive workflows, then implement caching, compression, RAG, and smart routing. These strategies offer multiplicative savings, ensuring your unit economics improve with success rather than degrade. Focus on building token-spending discipline, as this yields greater long-term cost control than one-time model price negotiations.

Key insights

Optimizing "tokens per task" through compression, RAG, caching, and routing yields multiplicative AI cost savings.

Principles

Method

Implement caching by placing stable content first in prompts. Utilize batch APIs for non-real-time workloads. Apply routing, compression, and RAG within application code to reduce tokens per task.

In practice

Topics

Best for: Director of AI/ML, AI Architect, MLOps Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by LLM on Medium.