opclaudecode
v0.1.0
Published
Universal provider proxy for Claude Code — use any LLM with Claude Code CLI
Downloads
6
Maintainers
Readme
Use GPT, Gemini, Grok, DeepSeek, Ollama, or any other LLM with Claude Code — without waiting for Anthropic to add support.
openclaudecode is a lightweight local proxy that translates Claude Code's Anthropic Messages API into whatever your provider speaks. Streaming, tool calls, reasoning tokens, images — everything works, in both directions.
Claude Code CLI ──/v1/messages──▶ openclaudecode ──▶ Any provider
│
OpenAI · Google · xAI · DeepSeek · Ollama · Groq
OpenRouter · Together · Fireworks · Mistral · …Quick start
# Install
npm install -g @bitkyc08/openclaudecode
# Interactive setup
occ init
# Start the proxy
occ start
# Use Claude Code through the proxy
ANTHROPIC_BASE_URL=http://127.0.0.1:10200 claudeHow it works
Claude Code sends requests in Anthropic's Messages API format. openclaudecode intercepts them and translates to the target provider's native format:
- OpenAI/xAI/DeepSeek/Groq/Ollama → Chat Completions API
- Google Gemini → Gemini generateContent API
- Anthropic (other key/model) → Messages API passthrough
Tool calls, streaming, images, and thinking/reasoning tokens are all translated bidirectionally.
Configuration
Config lives at ~/.openclaudecode/config.json:
{
"port": 10200,
"defaultProvider": "openai",
"providers": {
"openai": {
"adapter": "openai-chat",
"baseUrl": "https://api.openai.com/v1",
"apiKey": "${OPENAI_API_KEY}",
"defaultModel": "gpt-5.5",
"models": ["gpt-5.4", "gpt-5.4-mini"]
},
"google": {
"adapter": "google",
"baseUrl": "https://generativelanguage.googleapis.com/v1beta",
"apiKey": "${GEMINI_API_KEY}",
"defaultModel": "gemini-3.1-pro"
},
"ollama": {
"adapter": "openai-chat",
"baseUrl": "http://localhost:11434/v1",
"defaultModel": "llama3.3"
}
}
}Model naming
Use <provider>/<model> to route explicitly, or just the model name for auto-routing:
# Explicit provider
ANTHROPIC_BASE_URL=http://127.0.0.1:10200 claude --model openai/gpt-5.5
# Auto-routed (gpt- prefix → openai provider)
ANTHROPIC_BASE_URL=http://127.0.0.1:10200 claude --model gpt-5.5
# Local model
ANTHROPIC_BASE_URL=http://127.0.0.1:10200 claude --model ollama/llama3.3CLI
occ init # interactive setup
occ start [--port 10200] # start the proxy
occ stop # stop the proxy
occ status # check if running
occ help # show helpRoadmap
- [ ] Web dashboard (port from opencodex)
- [ ] OAuth support (xAI, Kimi)
- [ ] Web search sidecar
- [ ] Vision sidecar
- [ ] Background service (launchd/systemd)
- [ ]
ocx start --claudeunified mode with opencodex
Related
- opencodex — same idea, but for OpenAI Codex CLI
License
MIT
