Claude Model Pins and the Dead Anthropic Route
Bumped two Claude model settings in the dotfiles flake, and turned up a dead route while verifying.
Alias vs pinned ID
Claude Code’s fallbackModel was pinned to claude-sonnet-5 while its primary model was the alias opus. Switched the fallback to the alias sonnet (nix/home-manager/modules/coding-agents/claude/claude.nix:895) so the chain tracks the current Sonnet the way the primary tracks the current Opus.
That alias trick does not transfer to LiteLLM. programs.litellm.defaultClaudeModel is interpolated into model = "anthropic/${...}", and everything after the anthropic/ prefix goes straight to the Anthropic Messages API as the model field. Bare sonnet and opus are Claude Code CLI aliases resolved client-side; the API only accepts published IDs. anthropic/sonnet would 404 on first use and would also miss LiteLLM’s cost map, so spend tracking would break alongside it. Bumped the pin instead: claude-sonnet-4-6 → claude-sonnet-5.
Consumers of that option: the LiteLLM anthropic/* route and jupyter.nix’s initial_language_model (anthropic-chat:${...}).
The dead route
End-to-end test of the new route after hm switch:
litellm.BadRequestError: AnthropicException - {"type":"invalid_request_error",
"message":"Your credit balance is too low to access the Anthropic API."}
The request routed correctly and reached Anthropic — it’s a billing failure, not a routing or model-ID failure. But it means the direct Anthropic route through LiteLLM is unusable: MY_ANTHROPIC_API_KEY has no credit. Anthropic traffic that actually works goes via openrouter/anthropic/claude-sonnet-5 or Claude Code’s own subscription auth.
Side effect worth remembering: the billing check short-circuits before model validation, so a billing error does not confirm the model ID is valid. Can’t use this route to smoke-test model IDs until it’s funded.
Sonnet 5 caveat for clients on this route
If the route ever gets funded, Sonnet 5 rejects non-default temperature / top_p / top_k with a 400 (defaults or omission are fine), and manual budget_tokens thinking is gone. Anything pointed at anthropic/claude-sonnet-5 that sets a custom temperature will start failing where Sonnet 4.6 accepted it.
Related: Homelab Services Architecture, LLM Comparison Sources