◉CLAUDE LABJP
●WATERMARK — Since 11/16, text from Opus 4.6, Sonnet 4.5 and other models carries a watermark; non-default temperature and similar settings may drop it●CC 2.1.325 — Claude Code is still on 2.1.325 (11/13), with no newer release yet●SONNET 4.5 — Retires on the Claude API on 11/30, 13 days left. Sweep model IDs in code and saved settings in one pass●AUTOMATION — A user reports recurring AI jobs set up without run counts or a spending cap, burning through a weekly allowance●CONNECTOR — If connectors vanish only in new sessions, compare the /mcp list against an older session first●NEW — Cowork Feels Worse? Run the Same Request in Three Fresh Sessions●WATERMARK — Since 11/16, text from Opus 4.6, Sonnet 4.5 and other models carries a watermark; non-default temperature and similar settings may drop it●CC 2.1.325 — Claude Code is still on 2.1.325 (11/13), with no newer release yet●SONNET 4.5 — Retires on the Claude API on 11/30, 13 days left. Sweep model IDs in code and saved settings in one pass●AUTOMATION — A user reports recurring AI jobs set up without run counts or a spending cap, burning through a weekly allowance●CONNECTOR — If connectors vanish only in new sessions, compare the /mcp list against an older session first●NEW — Cowork Feels Worse? Run the Same Request in Three Fresh Sessions
TAG

Cost optimization

24 articles
← Back to all tags
Related:
Claude API14Claude Code5Prompt Caching3Sonnet 53production3streaming2indie dev2Opus 4.82Model Selection2batch processing2API2pricing2
⬡ API & SDK/2026-08-01Advanced

Swapping Tools Mid-Conversation Without Losing Your Prompt Cache

Tools can now be added and removed between turns, but the tool block sits at the very front of the cache prefix. I measured 12 mutation patterns with fingerprints and built a stable-core plus volatile-tail registry with a guard that refuses unsafe changes.

⬡ API & SDK/2026-05-14Advanced

6 Traps I Hit Building In-App AI Chat with Claude API — A Record of Getting to Production

Six real design mistakes I encountered shipping Claude API in-app chat to production — covering context management, streaming error detection, guardrails, session persistence, model versioning, and cost monitoring. Includes working TypeScript code.

⬡ API & SDK/2026-05-12Advanced

Combining Haiku 4.5, Streaming, and Prompt Caching to Cut Costs in a Personal App — An Implementation Record

A hands-on record of combining Claude Haiku 4.5, streaming, and prompt caching to improve both cost and response speed in a personal iOS/Android app — including the mistakes made along the way.

◉ Claude AI/2026-04-26Advanced

Claude Sonnet 4.6 vs Opus 4.6 — A Task-by-Task Selection Guide From Daily Use

Choosing between Sonnet 4.6 and Opus 4.6 comes up more often than you'd expect. From someone who uses both daily, here's a task-by-task breakdown — plus how the same yardsticks carry over to Sonnet 5 and Opus 4.8, and where a narrower price gap moves the break-even.

⬡ API & SDK/2026-04-11Intermediate

Running Claude's Message Batches Overnight — What the 50% Discount Actually Covers

What I learned running Claude API Message Batches for real: what the 50% discount covers, the custom_id character restriction, and designing around the 24-hour window and 29-day retention.

⬡ API & SDK/2026-04-02Advanced

Claude API Messages Batches: Cutting Production Costs by Up to 50% with Async Processing

Field notes from running the Claude API Messages Batches API in production. Polling design, composite custom_id keys, the 29-day window that starts at created_at rather than completion, and the cost numbers recomputed from current published prices.

⟐ Claude Code/2026-07-05Advanced

When to Use Claude Code's Native 1M Context — and When Not To: A Cost-Based Rule

With Sonnet 5 as the default, Claude Code now handles a native 1M-token context. A big window is convenient, but every token you park in it is billed again each turn. Should you load the whole repo, or feed slices? Here is an estimable token model and a decision rule that gives a concrete answer per situation, with working code and the traps to avoid.

⬡ API & SDK/2026-07-02Intermediate

Introductory Pricing Has an End Date — Effective-Dated Cost Forecasts for the Sonnet 5 Price Step

Claude Sonnet 5's introductory $2/$10 pricing ends on 2026-08-31 and reverts to $3/$15. A static price map will quietly understate your September forecast by a third. Here is an effective-dated price table and forecast design that absorbs the step.

⬡ API & SDK/2026-07-01Advanced

When Claude API Document Extraction Is Confidently Wrong — Field Notes on Catching Silent Errors with Invariants

In structured extraction from invoices and contracts, the real danger isn't a crash — it's a value that's silently wrong while the schema validates and confidence reads high. Field notes on invariants, two-pass extraction, and tracking field-level error rates.

⬡ API & SDK/2026-06-29Advanced

Stop rebuilding intermediate files every request: reuse the Code Execution container to carry pipeline state

How to reuse the Code Execution container across requests by passing its container ID, so generated files and intermediate results carry over to the next step. Includes the execution-time billing trap and how to handle container_expired safely, with working code.

⬡ API & SDK/2026-06-28Advanced

Every Tool Call Succeeds, Yet Nothing Moves Forward: Detecting Stagnation in Unattended Agents

No errors, yet the agent keeps replaying the same move while your budget quietly drains. Here is how to detect a success-but-no-progress loop using a progress oracle and action fingerprints, with a working Python implementation that halts safely.

⬡ API & SDK/2026-06-22Advanced

Your Claude Files API Storage Is Quietly Filling Up — Dedup With a Content-Hash Ledger and Reap the Orphans

Use the Files API in an automated pipeline and the same file gets uploaded again and again while orphaned files pile up unnoticed. Here is a content-hash dedup ledger plus an orphan GC design, with working code.