DeepSeek + Qwen in Claude Code: One Key, Many Models
DeepSeek Claude Code setup: use DeepSeek and Qwen through one relay key and shared wallet — learn when each model makes sense and how billing works.
AI 编程、Claude Code 优化与高性价比开发实践
DeepSeek Claude Code setup: use DeepSeek and Qwen through one relay key and shared wallet — learn when each model makes sense and how billing works.
How Claude pay-as-you-go pricing works in 2026: exact per-token API rates for Opus 4.8, Sonnet 4.6, and Haiku 4.5, prompt-cache and batch discounts, and when metered billing beats a Pro or Max subscription.
How Claude API rate limits work in 2026: RPM, ITPM, and OTPM; the four spend-based usage tiers and how you advance; why cached reads don't count; and how to handle 429s.
What ANTHROPIC_BASE_URL does, how to set it for Claude Code and the Anthropic SDK, the trailing-/messages 404 trap, how to verify with curl, and how to switch back to the official endpoint.
The real ways to get cheaper Claude API access in 2026 — right-sizing the model, prompt caching, batch, subscription vs pay-as-you-go, and relays — with an honest look at the trade-offs of each.
Claude Code token cost grows super-linearly because context is re-sent every turn. Here's why long sessions get expensive and the concrete levers to cut spend.
A claude compatible api relay speaks the same endpoints Claude Code already uses. Here's how relays work, why your CLI can't tell, and whether to trust one.
Claude Sonnet 4.6 vs Opus 4.8 for Claude Code: Sonnet is cheaper and faster for daily coding; Opus 4.8 wins hard refactors and architecture. Task-by-task picks, token cost, and the in-session /model switch.
Claude Code vs Codex CLI compared on workflow, protocol, and config — run both agentic coding CLIs off one sk-relay key because we expose both protocols.
A Claude Code connection error or timeout usually has a boring cause. Here's the diagnostic ladder to tell a real network/config fault from the model thinking.
Run Claude Opus 4.8 in Claude Code: exact model IDs, the ANTHROPIC_BASE_URL setup, whether the 1M-token context window is still available, and how to keep the bill down.
A plain-English breakdown of what Claude Code actually costs in 2026 — the official Pro and Max subscription tiers, how token-metered API billing compares, and when a relay subscription at a fraction of the price makes sense.
Step-by-step setup for pointing Cline and Roo Code — the VS Code AI coding extensions — at an Anthropic-compatible relay. Provider settings, base URL, model IDs, and the gotchas with OpenAI-compatible vs native Anthropic mode.
Point Codex CLI, the OpenAI SDK, or LiteLLM at Claude models with one OpenAI-compatible key. Exact /v1/responses and /v1/chat/completions setup, the wire_api gotcha, and a Codex config.toml walkthrough.
Open-weight reasoning models (DeepSeek V3.x, MiniMax M-series, Qwen3 reasoning) now ship interleaved thinking blocks. Notes on translating that to Claude Code's Anthropic-protocol contract — block ordering, signature handling, tool-use interleaving, and SSE shape.
Postmortem on a relay process that pegged a single core for fifteen seconds straight. Catastrophic regex backtracking on user-controlled input. Three-character fix, three-layer defense (bounded quantifier + per-request watchdog + nginx next_upstream).
Long Claude Code sessions sometimes produced duplicate `tool_use_id` values from the upstream model. Naive fixes break round-trip correlation; the working answer is occurrence-counter dedup with two-direction translation. With diagnostic dumps for the cases that still slip.
Long Claude Code conversations degrade past ~400K tokens: fabricated paths, skipped TODOs, contradicted decisions. The naive fix (open a new window) fails because self-summaries lie. Here is the self-audit pattern that catches the lying — and the open-source skill that automates it.
Step-by-step triage for Claude Code 429 errors. Learn the three types of rate limits, how to read headers, short-term workarounds, and the structural fix via a multi-provider relay.
Real options for running Claude Code productively from mainland China: VPN tradeoffs, domestic-accessible relays, self-hosted proxies, and a 60-second setup with Alipay/WeChat billing.