Skip to main content
The LithosAI API supports many coding agents, including Codex, Claude Code, and OpenCode. OpenCode connects directly. Codex and Claude Code each require a different protocol, so a local translation proxy is needed. Export your key once, in whichever shell you use to start these tools.
LithosAI validates tool schemas strictly. An agent that loads an MCP server whose tool parameters are not a JSON Schema object is rejected with invalid 'parameters' schema. Disable that server or correct its schema.

Codex

Codex no longer speaks Chat Completions. wire_api = "chat" is rejected at startup, and responses is the only accepted value, so Codex reaches LithosAI through a proxy that accepts Responses API requests.
1

Install LiteLLM

LiteLLM bridges the Responses 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.
2

Configure the proxy

Give the model the openai/ prefix and set use_chat_completions_api, which bridges incoming /v1/responses requests to LithosAI’s /v1/chat/completions.
codex.litellm.yaml
drop_params discards parameters a model does not accept rather than failing the request. master_key is the token Codex sends to the proxy, not your LithosAI key.
3

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.
4

Point Codex at it

~/.codex/config.toml
env_key names the variable holding the proxy’s master_key, so export that too.

Troubleshooting

Claude Code

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.
1

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.
2

Configure the proxy

Give each model the hosted_vllm/ prefix. It routes /v1/messages straight to Chat Completions and maps replies, including reasoning, back into Anthropic content blocks.
claude-code.litellm.yaml
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.
3

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.
4

Point Claude Code at it

ANTHROPIC_SMALL_FAST_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

OpenCode

OpenCode reaches LithosAI directly, with no proxy and nothing to install. Declare the provider in opencode.json, either in a project or at ~/.config/opencode/opencode.json.
opencode.json
@ai-sdk/openai-compatible is the package for Chat Completions providers, and OpenCode bundles it. Start OpenCode as usual.