Skip to main content

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:
Here 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

  1. 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.
  2. Run cmx providers <client> list. If your intended provider is missing or reports missing credentials, finish setup in the native client before changing routing.
  3. Run cmx providers <client> connect <displayed-id>. Restart the client, make a real request, and check cmx stats.
  4. To go direct again, run cmx providers <client> disconnect <displayed-id> and restart the client. See Undo and uninstall.
The same workflow covers OpenRouter, DeepSeek, Groq, Gemini, Mistral, Together AI, Perplexity, xAI, Ollama, Command Code, OpenCode Zen/Go, and other configured services when the client exposes them. A CMX upstream ID by itself cannot add a provider to a client. For local Ollama, start Ollama first and configure its native endpoint in a compatible client. Use the client-specific instructions for the settings CMX can manage.

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’s config.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.
Last modified on September 24, 2026