name: claude-bridge-orchestration description: Configuration and orchestration patterns for running Claude Code CLI via a local translation bridge to OpenAI-backed providers (like 9router).
When Claude Code must run on a host VPS but needs to route via a local 9router (using OpenAI backend):
npm install -g @anthropic-ai/claude-code.claude_openai_bridge.py) that implements a basic Anthropic Messages API -> OpenAI API converter. The bridge must handle HEAD (connectivity check), GET /v1/models (model listing), and POST /v1/messages (chat)./v1 to the base URL automatically. Set ANTHROPIC_BASE_URL to http://127.0.0.1:<port> (without a trailing path). The bridge should listen on /v1/messages directly.~/.claude/settings.json points to the bridge URL (e.g., http://127.0.0.1:20131).http://127.0.0.1:20128/v1.claude-3-5-sonnet-20241022 or any Anthropic model ID — the bridge does not actually call it./etc/systemd/system/claude-bridge.service). Use BRIDGE_HOST, BRIDGE_PORT, BRIDGE_UPSTREAM_BASE, BRIDGE_UPSTREAM_KEY env vars.--model flag with full model names may fail resolution. Use aliases like sonnet instead of full IDs.cc provider does not map claude-sonnet-5 to an OpenAI model. The bridge must bypass the cc provider entirely and call the OpenAI-compatible endpoint of 9router.HEAD /v1 is required for Claude Code's connectivity test — the bridge must respond 200, not 501.claude CLI when the user explicitly requests code, repo, file, test, bug, terminal, or system review/fix. Always prefer chat for normal text or planning.See scripts/claude_openai_bridge.py for a functional ThreadingHTTPServer bridge example.