opusgate.
ModelsQuickstartPricing
Getting started
Overview
Setup guides
Claude CodeCodex CLICursorClineRoo CodeKilo CodeContinueOpenCode
API reference
Endpoints & authError codesRate limits
Account
API keysBilling & pricing
Reference
FAQTerms of ServicePrivacy Policy
opusgate.Opening your next page…
← PreviousClaude CodeNext →Cursor
opusgate.

AI models, one connection.
Build with your tools or start in chat.

Product

ModelsPricingWorkspacePayment methods

Get connected

Claude CodeCursorAPI referenceAll setup guides

Help

SupportFAQTermsPrivacy
© 2026 OpusGateModel and tool names belong to their respective owners.

Codex CLI

OpenAI's Codex CLI supports custom model providers via ~/.codex/config.toml. Point it at OpusGate's Responses endpoint. Use a model that supports your task and test a short turn before a longer run. Codex reads the API key from an environment variable, not from the config file.

Required values
base_url: https://api.opusgate.dev/v1 (with /v1).
wire_api: responses — sends requests to /responses.
Key: env var OPUSGATE_API_KEY = your sk-og-... from the Keys page.

The current official Codex configuration reference supports the Responses protocol for custom providers. Older examples using wire_api = "chat" are outdated. Model listing alone does not establish compatibility with every Codex tool or feature.

1. Install Codex

Bash
npm install -g @openai/codex
codex --version

2. Config

Merge into ~/.codex/config.toml (create it if missing):

TOML
model = "gpt-6-sol"
model_provider = "opusgate"

[model_providers.opusgate]
name = "OpusGate"
base_url = "https://api.opusgate.dev/v1"
env_key = "OPUSGATE_API_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false

3. Set the key and run

macOS / Linux
Bash
export OPUSGATE_API_KEY="sk-og-..."
codex

Add the export line to ~/.zshrc / ~/.bashrc to persist it.

Windows (PowerShell)
PowerShell
setx OPUSGATE_API_KEY "sk-og-..."
# setx affects NEW terminals — set it for this one too:
$env:OPUSGATE_API_KEY = "sk-og-..."
codex

Or auto-install: one script does everything

Installs Codex if it's missing (needs npm) and writes ~/.codex/config.toml (backing up an existing one to config.toml.bak). You still set the env var from step 3 yourself.

macOS / Linux
Bash
command -v codex >/dev/null 2>&1 || npm install -g @openai/codex
mkdir -p ~/.codex
[ -f ~/.codex/config.toml ] && cp ~/.codex/config.toml ~/.codex/config.toml.bak
cat > ~/.codex/config.toml <<EOF
model = "gpt-6-sol"
model_provider = "opusgate"

[model_providers.opusgate]
name = "OpusGate"
base_url = "https://api.opusgate.dev/v1"
env_key = "OPUSGATE_API_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
EOF
echo "Done — set OPUSGATE_API_KEY and run 'codex'."
Windows (PowerShell)
PowerShell
if (-not (Get-Command codex -ErrorAction SilentlyContinue)) { npm install -g @openai/codex }
$dir = "$env:USERPROFILE\.codex"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
if (Test-Path "$dir\config.toml") { Copy-Item "$dir\config.toml" "$dir\config.toml.bak" -Force }
[IO.File]::WriteAllText("$dir\config.toml", @"
model = "gpt-6-sol"
model_provider = "opusgate"

[model_providers.opusgate]
name = "OpusGate"
base_url = "https://api.opusgate.dev/v1"
env_key = "OPUSGATE_API_KEY"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
"@)
Write-Host "Done - set OPUSGATE_API_KEY and run 'codex'."

Troubleshooting

"Missing environment variable OPUSGATE_API_KEY"

The variable isn't visible to the shell running codex. On Windows remember that setx only affects new terminals; on macOS/Linux make sure the export is in the rc file of the shell you actually use.

Codex still asks for a ChatGPT login

It ignores the custom provider when model_provider isn't set at the top level of config.toml. Check for typos — the value must match the table name ([model_providers.opusgate] → model_provider = "opusgate").

401 / 402 errors

401 → key mistyped or revoked (Keys); 402 → empty balance (top up). Full list: error codes.