OpenAI Codex

OpenAI Codex supports custom model providers, so you can route requests to the Admesh gateway.

Config file

Edit ~/.codex/config.toml:

model_provider = "admesh"
model = "openai/gpt-4o"

[model_providers.admesh]
name = "Admesh"
base_url = "https://gateway.admesh.ai/v1"
wire_api = "responses"

Auth file

Edit ~/.codex/auth.json:

{
  "OPENAI_API_KEY": "sk-live-..."
}

Verify

Run codex. If authentication fails, confirm auth.json holds the full key and base_url ends in /v1.