OpenAI-Compatible Provider Routing
CCS can bridge Claude Code into OpenAI-compatible providers through a local Anthropic-compatible proxy. This is useful for Hugging Face Inference Providers, OpenRouter, Ollama, llama.cpp, OpenAI-compatible self-hosted gateways, and similar APIs.Quick Start
Create an API profile, then launch it normally:127.0.0.1, translates Anthropic /v1/messages
requests into OpenAI chat-completions requests, and translates streaming
responses back into Anthropic SSE.
Manual Proxy Lifecycle
Use theccs proxy command when you want to start, inspect, activate, or stop
the local proxy explicitly:
ccs proxy activate prints the local runtime contract for the selected
profile, including ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, model
defaults, timeout settings, telemetry suppression, and NO_PROXY.
Adaptive Ports
CCS stores local proxy state per profile, so multiple compatible profiles can run at the same time. Port selection precedence:- CLI
--port proxy.profile_ports[profile]- shared preferred
proxy.port - adaptive per-profile fallback
proxy.port: 3456 values are treated as unset so older configs
move onto adaptive ports instead of staying on the hot legacy default. Pin
3456 explicitly with --port or proxy.profile_ports only if you really need
that exact binding.
Request-Time Routing
The proxy can route a request to another compatible profile or model at request time:
Scenario routing is configured under
proxy.routing:
Anthropic Passthrough Profiles
Most compatible profiles translate Claude Code’s Anthropic/v1/messages
requests into OpenAI /chat/completions requests before forwarding upstream.
Some coding endpoints, including Kimi for Coding, already expect Anthropic
message payloads and reject OpenAI-formatted chat-completions requests.
For those profiles, CCS uses passthrough mode. It forwards the original
Anthropic request body to the upstream /v1/messages endpoint and preserves the
incoming coding-agent User-Agent header when present.
Passthrough is automatic for known Anthropic-style hosts such as
api.kimi.com and api.anthropic.com. For another gateway that expects
Anthropic /v1/messages, set this env key in the profile:
Reasoning Model Payloads
OpenAI GPT-5 and o-series chat-completions models rejectmax_tokens and expect
max_completion_tokens instead. CCS automatically reshapes payloads for known
public model names such as gpt-5.4, openai/gpt-5.4, and o3.
If your OpenAI-compatible gateway exposes a reasoning model through an opaque
deployment ID, CCS cannot infer that from the model string. Add this env key to
that profile’s settings:
max_tokens to max_completion_tokens and strips
OpenAI-incompatible metadata from the upstream chat-completions request. Leave it
unset for generic gateways whose models still require max_tokens.
Related Project
claude-code-router is a standalone router whose transformer architecture informed this CCS flow. Use CCR when you want a standalone router. Use CCS when you want routing integrated with CCS profiles, runtime bridges, and theccs command surface.
