Claude Code: Multiplicador Real de Tokens y Optimización BYOK
Anthropic's agentic terminal CLI with native prompt caching, subagent delegation, and /compact memory control.
Context & Token Overhead Mechanics
In a 15-turn refactor with 5 tool calls, Claude Code amplifies raw prompt tokens by 1.8x–2.5x due to bash/file read loops, but 80%+ cache hits cut effective input cost by ~75%.
Baseline instructions & tool schema weight per turn
Native Prompt Caching + threshold-triggered /compact LLM summarization when context fills
Automatically marks system prompt, CLAUDE.md, and tool definitions with cache_control breakpoints.
Model Compatibility Matrix & 15-Turn Cost
Estimated on 30k raw input + 4.5k output scaled by 2.1x multiplier at 70% cache hit rate
| Model | Tool Calling | Prompt Caching | Vision | Streaming | Est. 15-Turn Cost |
|---|---|---|---|---|---|
| Anthropic: Claude Sonnet 5.5Primary | Native | Full | Supported | Stable | $0.107 |
| Anthropic: Claude Opus 5.5Architect / Complex | Native | Full | Supported | Stable | $0.214 |
| Anthropic: Claude Haiku 5.5Fast Subagent | Native | Full | Supported | Stable | $0.006 |
| DeepSeek: DeepSeek V4.1 FlashBudget BYOK | Native | Provider-Dependent | Supported | Stable | $0.002 |
Production BYOK & DeepSeek / OpenRouter Config
Supports Anthropic API keys directly or any Anthropic-Messages-compatible endpoint (such as OpenRouter or DeepSeek Anthropic endpoint) via ANTHROPIC_BASE_URL.
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_API_KEY="${DEEPSEEK_API_KEY}"
export ANTHROPIC_MODEL="deepseek-chat"
export ANTHROPIC_SMALL_FAST_MODEL="deepseek-chat"
export API_TIMEOUT_MS="600000"