◉CLAUDE LABJP
●2.1.334 — Claude Code 2.1.334: /model now has a search box once the list passes 25 models, matching names and model IDs●FAST — Fast mode for Claude Opus 4.8 ended on 11/30. Drop speed: "fast" and Opus 4.8 keeps working●OPUS 4.5 — claude-opus-4-5 retires on 2027/1/22, 50 days from now. The replacement is claude-opus-5-5●IME — On the Windows desktop app, pressing Enter to confirm Japanese IME input can send the message early●NEW — New: Compare tool-use requests across three routes before moving to Bedrock●MCP — More setups now share one local MCP server across Claude Code, Cursor and Antigravity●2.1.334 — Claude Code 2.1.334: /model now has a search box once the list passes 25 models, matching names and model IDs●FAST — Fast mode for Claude Opus 4.8 ended on 11/30. Drop speed: "fast" and Opus 4.8 keeps working●OPUS 4.5 — claude-opus-4-5 retires on 2027/1/22, 50 days from now. The replacement is claude-opus-5-5●IME — On the Windows desktop app, pressing Enter to confirm Japanese IME input can send the message early●NEW — New: Compare tool-use requests across three routes before moving to Bedrock●MCP — More setups now share one local MCP server across Claude Code, Cursor and Antigravity
TAG

claude-api

85 articles
← Back to all tags
Related:
production44cost-optimization17tool-use12python8prompt-caching7api-sdk7observability7troubleshooting6error-handling6agent6fallback5rate-limit5
⬡ API & SDK/2026-11-23Beginner

How Many Input Tokens Does One More Tool Add? Separate the Fixed Overhead From Each Tool's Weight With count_tokens

Passing tools adds a fixed, model-specific block of tokens on top of the definitions themselves. A leave-one-out script for count_tokens, what to check when the fixed part doesn't match the docs, and how to read the shift from Opus 4.5 or Sonnet 4.6 to the 5.5 models in both tokens and dollars: the fixed part shrinks while the definitions grow.

⬡ API & SDK/2026-11-20Intermediate

When the Claude API Only Says “Connection error.”, Follow the Exception Three Levels Down and Sort It Into Four Causes

The Python SDK raises the same APIConnectionError message for DNS, proxy, certificate, and timeout failures. Here is a script that walks __cause__, the real output from reproducing all four, and the order I fix them in.

⬡ API & SDK/2026-09-22Intermediate

Character counts won't predict PDF input tokens — bracket the cost per page before you send

How to estimate the input tokens of a PDF before sending it to the Claude API, by bracketing from page count rather than character count. Includes a measured 6.6x gap on a nine-page A4 document, the two separate increases that come with current models, and the count_tokens limitation that bites when you use file_id.

⬡ API & SDK/2026-09-07Intermediate

A 75% cheaper cache read moved one bill by 29% and another by 2.8%

Fable 5.1 and Mythos 5.1 changed the cache read multiplier from 0.1 to 0.025. Here is how to estimate your own saving from your token mix, and how to fix code that hard-codes the multiplier.

⬡ API & SDK/2026-06-12Intermediate

Handing Monthly Revenue CSVs to the Claude API Code Execution Tool — Files API Wiring, Container Reuse, and Billing Traps

How I moved monthly revenue-CSV reconciliation into the Claude API Code Execution tool — a pre-upload sanity check, Files API integration, container reuse, the 5-minute billing minimum, and the file recovery that pause_turn quietly drops.

⬡ API & SDK/2026-05-26Advanced

Stabilizing Claude API Structured Responses in Production — Notes on tool_use, JSON Schema, and Layered Validation

Getting Claude to return JSON takes a few lines. Keeping that JSON usable in production is a different problem. Here is the layered design I landed on after running a wallpaper classification pipeline through Claude API, built around tool_use, JSON Schema, and domain validation.

⬡ API & SDK/2026-05-25Advanced

A Two-Tier Setup — Haiku 4.5 Orchestrator with Opus 4.6 Worker for Balancing Cost and Quality

An indie developer's two-tier setup — Haiku 4.5 as orchestrator, Opus 4.6 as worker — costed line by line against published rates, plus the price increase I planned around that never arrived and the tokenizer split that quietly moves every token-denominated threshold.

⬡ API & SDK/2026-05-22Intermediate

Designing a Model-Selection Fallback That Survives this model is currently unavailable on Claude API

When Claude API says a model is currently unavailable, treating it like a 529 or 429 sends you the long way round. Ahead of the November 30 Sonnet 4.5 retirement, here is how I check model lifecycle and thinking support through the Models API at startup, tell refusals apart by SDK exception class, and avoid the 400 that hits when the backup model wants thinking written differently.

⬡ API & SDK/2026-05-22Advanced

Why tool_result could not be submitted Keeps Coming Back, and How to Build a Recovery Handler That Actually Holds

Run a Claude agent long enough and one day it starts: 'tool_result could not be submitted', back to back, and retries change nothing. The error message hides four completely different root causes. Here is what I learned debugging it on the always-on agent jobs I run as an indie developer, with the TypeScript recovery handler I now ship in production.

⬡ API & SDK/2026-05-19Advanced

Hierarchical Chat History Summarization with Claude API: A 3-Tier Design That Cut Tokens by 70%

Working TypeScript design for compressing long in-app chat histories into three tiers — recent turns kept verbatim, mid-range episodes summarized with Haiku 4.5, and long-range memory distilled to JSON by Sonnet 4.6. Includes seven weeks of production data showing input tokens down 70% and monthly API cost down from $480 to $145.

⬡ API & SDK/2026-05-13Advanced

Design Decisions Every Indie Developer Faces When Integrating Claude API into Mobile Apps

The design decisions indie mobile developers hit when integrating Claude API — model selection, async UX, context management, offline resilience, and cost control — with working code and a per-user cost table recalculated from official October 2026 pricing.

⬡ API & SDK/2026-05-10Advanced

Making Claude API JSON Output Reliable: A Four-Layer Defense That Outlived Prefill

Prefill now returns a 400 on Claude 4.6 and later, and Sonnet 4.5 retired on November 30, 2026. How I swapped Layer 1 for output_config.format and kept the validation, repair and retreat layers, plus the 1,081-sample truncation benchmark behind the repair code and a troubleshooting table.