COST OPTIMIZATION
16 items
16 posts
Caching a shared prompt cut our worked example by about 78-80% on four models; batch takes 50% off at most providers but 40% at Moonshot and 20% at xAI. Only Anthropic, Fireworks and xAI say the two stack. The math, the assumptions and the quotes.
At the same 1K size label, per-image API prices run from $0.003 to $0.22. At 720p, video runs from $0.025 to $1.50 a second. The like-for-like math, the units that do not convert, what retires this week, and where the providers' own docs disagree.
Prompt caching across OpenAI, Anthropic, Gemini, DeepSeek, Mistral, xAI and Qwen: prices, TTLs, setup code. A reused 100K prefix costs 71-93% less.
Coding harness choice moved cost per task by more than 2x at the same quality in a Databricks benchmark. Why Pi's minimal context discipline explains the gap.
AI model routing for cost-effective coding: pick Claude, GPT-5.6 or Kimi tiers by task complexity, cost and latency, with decision frameworks and code.
Comparing LLMs by token pricing alone can lead you to choose worse, more expensive models. Cost per task tells the real story.
Image token compression cuts agent costs by rendering bulky context as images, but it is lossy. Where to use it, the byte-safety rule, and the evals it needs.
Factory Router explained: automatic model routing and failover for Droid sessions, which spend and reliability claims are vendor claims, and router vs DIY.
Fable 5 prompt caching economics: cache-write vs cache-read pricing, 5-minute vs 1-hour TTL break-even math, and worked agent-loop examples.
Claude Fable 5's $10/$50 per million token pricing can catch teams off guard - here is how to build a real cost model before you commit.
Factory AI's Droid lets you pick a model per task and per subagent. What its routing, BYOK and open-weight tiers reveal about cutting coding agent costs.
MiniMax M2.5 hits 80.2% on SWE-bench Verified and plugs into the Anthropic SDK with two environment variables. Here is what you need to know before switching.
DeepSeek V4 brings near-frontier coding at a much lower token price. Where cheap reasoning fits in a coding agent stack, from code review to repo mapping.
How to ship Claude's Batch API in production. 50% cost savings, TypeScript SDK code, JSONL request format, and the async architecture gotchas that bite at 100k requests.
A production guide to Claude's extended thinking mode. Real cost math, TypeScript SDK code, and the tasks where reasoning tokens are worth 3x the spend.
Cut Claude API spend by up to 90% with prompt caching. Real numbers, TypeScript SDK code, and the gotchas Anthropic's docs gloss over.

Get Smarter About AI Dev
New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.