Skip to content

Providers

A provider is one upstream LLM endpoint plus how to reach it: an adapter, a base URL, an auth mode, and an optional model list. Providers live under providers in ~/.opencodex/config.json.

Every provider has an authMode (default key):

authModeHow it authenticatesUsed by
keySends your API key (Authorization: Bearer …, or x-api-key / api-key per adapter). The key may be a literal or an ${ENV_VAR} reference.Most providers.
forwardRelays your incoming Codex auth headers verbatim to the provider — no key stored. This is the ChatGPT-login passthrough.OpenAI (openai-responses adapter).
oauthResolves a stored OAuth access token (auto-refreshed before expiry) and uses it as the bearer key.xAI, Anthropic, Kimi.

The default provider needs no API key. It forwards the credentials from your existing codex login straight to the OpenAI Responses backend:

{
"openai": {
"adapter": "openai-responses",
"baseUrl": "https://chatgpt.com/backend-api/codex",
"authMode": "forward"
}
}

Only a curated set of headers is forwarded (FORWARD_HEADERS: authorization, ChatGPT account id, OpenAI beta/originator/session — see Adapters). This path is also what powers the web-search and vision sidecars.

Three providers support real account login. opencodex stores the credential in ~/.opencodex/auth.json and refreshes it automatically:

Terminal window
ocx login xai # xAI Grok
ocx login anthropic # Anthropic Claude (Pro/Max)
ocx login kimi # Moonshot Kimi
ocx logout <provider>
ProviderAdapterBase URLNotes
xaiopenai-chathttps://api.x.ai/v1Grok models; some have no reasoning param (handled automatically).
anthropicanthropichttps://api.anthropic.comClaude models; live model list fetched from /v1/models.
kimiopenai-chathttps://api.kimi.com/coding/v1Kimi K2 family.

You can also start OAuth from the web dashboard.

opencodex ships a catalog of key-based providers (mostly OpenAI-compatible, a few Anthropic-compatible). The dashboard’s Add provider picker opens the provider’s key dashboard, validates the key, and stores it. Notable entries:

ProviderBase URL
Ollama Cloudhttps://ollama.com/v1
Mistralhttps://api.mistral.ai/v1
MiniMax · MiniMax (CN)https://api.minimax.io/v1 · https://api.minimaxi.com/v1
DeepSeekhttps://api.deepseek.com
Cerebrashttps://api.cerebras.ai/v1
Togetherhttps://api.together.xyz/v1
Fireworkshttps://api.fireworks.ai/inference/v1
Moonshot (Kimi API) · Kimi (coding)https://api.moonshot.ai/v1 · https://api.kimi.com/coding/v1
Hugging Facehttps://router.huggingface.co/v1
NVIDIA NIMhttps://integrate.api.nvidia.com/v1
Z.AI (GLM Coding)https://api.z.ai/api/coding/paas/v4
Qwen Portalhttps://portal.qwen.ai/v1
Xiaomi MiMohttps://api.xiaomimimo.com/anthropic
Kilohttps://api.kilo.ai/api/gateway
GitHub Copilot · GitLab Duohttps://api.githubcopilot.com · https://cloud.gitlab.com/ai/v1/proxy/openai/v1
Cloudflare AI Gatewayhttps://gateway.ai.cloudflare.com/v1/{account}/{gateway}/anthropic
…and moreopencode zen, Vercel AI Gateway, Venice, NanoGPT, Synthetic, Qianfan, Alibaba, Parallel, ZenMux, LiteLLM

Most use the openai-chat adapter with a bearer key; a few that expose only an Anthropic-compatible endpoint (e.g. Xiaomi MiMo) use the anthropic adapter (x-api-key).

Ollama Cloud is a hosted (not local) Ollama, OpenAI-compatible at https://ollama.com/v1 with a key from ollama.com/settings/keys. opencodex classifies its cloud lineup by vision capability so the vision sidecar only kicks in for text-only models. Text-only models (e.g. glm-5.2, deepseek-v4-pro, gpt-oss, qwen3-coder, minimax-m2.x, nemotron-3-*) are listed in noVisionModels; vision-native models (e.g. kimi-k2.6, minimax-m3, gemma4, qwen3.5, gemini-3-flash-preview) are not. Matching is tolerant of Ollama’s :size tags, so gpt-oss covers gpt-oss:120b and gpt-oss:20b.

Point opencodex at a local OpenAI-compatible server — usually with a blank key:

ProviderBase URL
Ollama (local)http://localhost:11434/v1
vLLMhttp://localhost:8000/v1
LM Studiohttp://localhost:1234/v1

If a provider speaks Chat Completions, the openai-chat adapter handles it — choose Custom in the dashboard or custom in ocx init and enter the base URL. See the Configuration reference for every provider field (headers, noReasoningModels, noVisionModels, models, …).