Model providers and routes
A model provider is the service that answers a request from your coding client. A coding client is Codex, OpenCode, Claude Code, Aider, Antigravity CLI, or Cline. Connect the client first using its client guide. Its normal sign-in or API key remains with that client; CMX does not create a provider account or save provider keys. CMX has these built-in upstream IDs in the current source:
A built-in ID means CMX knows an upstream endpoint shape. It does not mean your coding client has credentials, that every model works, or that every protocol is compressed. Credentials and available models come from the native client and provider. Check readiness with
cmx providers <client> list, then connect an ID that the client actually shows. For example:
api is a Codex connection ID, while openai is a CMX upstream ID. Those names serve different purposes. For OpenCode, the displayed provider ID is the one to pass to cmx providers opencode connect <provider-id>.
Connect a service you already use
- Configure the service’s account, API key, and model inside your coding client. Use that client’s own sign-in flow. For example, Codex can use OpenAI API or ChatGPT sign-in, Claude Code can use Anthropic access, OpenCode can manage several services, and Cline can use Cline’s account or its own provider settings.
- Run
cmx providers <client> list. If your intended provider is missing or reports missing credentials, finish setup in the native client before changing routing. - Run
cmx providers <client> connect <displayed-id>. Restart the client, make a real request, and checkcmx stats. - To go direct again, run
cmx providers <client> disconnect <displayed-id>and restart the client. See Undo and uninstall.
Custom providers
A provider must have a valid direct endpoint. CMX accepts HTTPS upstreams and HTTP only for exact loopback hosts, such as a local Ollama service. A malformed URL or an endpoint pointing back at CMX is rejected. For OpenCode, configure a custom provider’s direct endpoint in OpenCode first, then list and connect it through CMX. Do not put provider API keys in CMX’sconfig.json.
The documented compression path covers OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages. Native endpoints for other formats can be proxied without compression. See Custom clients and How compression works.