How one developer runs Claude Code across two cost tiers using a self-hosted proxy
A developer has configured Claude Code to operate across two trust levels — one using a paid Anthropic subscription for high-stakes tasks, and another routed through a self-hosted LiteLLM proxy to cheaper DeepSeek models for exploratory or low-priority work. Because Claude Code only communicates via Anthropic's Messages API, the setup required pointing the ANTHROPIC_BASE_URL environment variable to LiteLLM's Anthropic-compatible endpoint rather than its OpenAI-shaped path. A key obstacle was Claude Code's Plan Mode, which sends an unsupported parameter that causes non-Anthropic backends to return a 400 error; this was resolved by enabling LiteLLM's drop_params option to silently strip unrecognized fields. To prevent accidentally using the cheaper, less reliable session for critical work, the developer gave the two agents visually distinct terminal environments — keeping the premium session plain and wrapping the cheap one in a clearly labelled subshell. The approach relies on a persistent SSH tunnel from a VPS to route proxy traffic consistently across multiple machines.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in