Before you begin
Create a key on the API Keys page, confirm the model ID
on the Models page, and export the key in the shell where you start Claude Code or its local proxy.
Claude Code speaks the Anthropic Messages API, so its proxy needs a different configuration
from the one Codex uses. Run it on a second port to use both agents at once.
This is a community compatibility path for non-Claude models, not a configuration supported
by Anthropic. LiteLLM maps common Messages API behavior to Chat Completions, but native
thinking blocks, prompt caching, token counting, streaming details, and some tool-use flows
may behave differently.
Install LiteLLM
LiteLLM bridges the Anthropic Messages API to Chat
Completions.Install a current release. LiteLLM 1.82.7 and 1.82.8 were briefly replaced on PyPI in
March 2026 by a credential stealer. Configure the proxy
Give each model the hosted_vllm/ prefix. It translates /v1/messages requests into
Chat Completions requests for LithosAI.Do not reuse the Codex configuration here. An openai/ entry with
use_chat_completions_api answers /v1/messages with 200 OK and empty content, so
Claude Code appears to hang rather than reporting an error.
Start the proxy
Leave it running, and confirm it is up. The proxy holds your LithosAI key, so keep it
bound to 127.0.0.1 and do not expose it to a network. Point Claude Code at it
ANTHROPIC_DEFAULT_HAIKU_MODEL handles background work such as session titles. Without it,
those requests fail against a model the proxy does not serve.Setting ANTHROPIC_AUTH_TOKEN overrides a Claude.ai login for that shell. Export these
in a dedicated shell or profile to keep an existing subscription usable elsewhere.
Claude Code does not recognize LithosAI model names, so it assumes a 200k-token context
window and compacts early. Set the real window to avoid that.
Check the Models console page for each model’s
context window.
Troubleshooting
Issues common to every agent are listed under Common issues.