Codex
Codex speaks the OpenAI Responses API, so it can use the models served through Responses, such as GPT, Grok, and Muse Spark.
Configure
Add Console as a model provider in ~/.codex/config.toml and make it the default.
model = "gpt-5.5"
model_provider = "opencode"
[model_providers.opencode]
name = "OpenCode Console"
base_url = "https://opencode.ai/inference/openai/v1"
env_key = "OPENCODE_API_KEY"
wire_api = "responses"Codex appends /responses to the base URL and reads the key from env_key. Create a
personal API key, then export it.
export OPENCODE_API_KEY="oc_sk_..."
codex
Go
Use the Go base URL and a key from a workspace with a Go subscription.
model = "gpt-6-luna"
model_provider = "opencode-go"
[model_providers.opencode-go]
name = "OpenCode Go"
base_url = "https://opencode.ai/inference/go/openai/v1"
env_key = "OPENCODE_API_KEY"
wire_api = "responses"Models
Set model to a model that accepts the Responses API. Override it for one run with --model.
| Plan | Models |
|---|---|
| Pay-as-you-go | GPT, Grok, and Muse Spark models |
| Go | GPT, Grok, Muse Spark, and DeepSeek V4 |
codex --model grok-4.7
Claude, Gemini, and most open models are not available in Codex yet. Use Pi or Hermes for them in the meantime.
Codex doesn’t know the context window or reasoning settings of models outside its own catalog. It uses generic defaults for them and prints a warning, which you can ignore.
Profiles
Keep pay-as-you-go and Go side by side with a profile. Define both providers in ~/.codex/config.toml, then add a
profile file that switches to Go.
model = "gpt-6-luna"
model_provider = "opencode-go"codex --profile go
Console MCP
Add the Console MCP server and sign in from the browser.
codex mcp add opencode-console --url https://opencode.ai/console/mcp
If the sign-in doesn’t start automatically, run it yourself.
codex mcp login opencode-console