Skip to content

Codex

Configure OpenAI Codex to route Responses API calls through HeyEly.

Codex uses the OpenAI Responses API. Register HeyEly as a custom model provider in ~/.codex/config.toml with a base URL ending in /v1; Codex automatically appends /responses.

Set up

  1. Create an API key in Developers and export it as HEYELY_API_KEY in the shell where you launch Codex.
  2. Add the HeyEly provider block to ~/.codex/config.toml (or %USERPROFILE%\.codex\config.toml on Windows). Make sure the top-level keys stay above the first [table] header.
model = "openai/gpt-5.3-codex"
model_provider = "heyely"
web_search = "disabled"

[model_providers.heyely]
name = "HeyEly"
base_url = "https://heyely.si/v1"
wire_api = "responses"
env_key = "HEYELY_API_KEY"
  1. Restart Codex so it picks up the new provider.

Because Codex's native web search runs on OpenAI's hosted tool infrastructure, the snippet above disables it.

Keep these Codex-specific rules in mind:

  • Codex only honors provider declarations in your user-level config file. Placing model_provider or model_providers inside a project's .codex/config.toml triggers a startup warning and is ignored.
  • Provider names openai, ollama, and lmstudio are reserved; pick any other identifier such as heyely.
  • wire_api = "responses" is required and is the only supported wire format.
  • model must match an exact catalog ID from Models.
  • HEYELY_API_KEY must exist in the environment of the process launching Codex. GUI apps opened from the Dock or Start menu do not inherit shell exports automatically.

Verify

  1. Run codex doctor to validate your install, config file, and auth setup.
  2. Launch codex and run /status to confirm the active provider and model.
  3. Send Reply with exactly: gateway-ok.
  4. Open Credit and usage. Your test request appears first under Spend, with From identifying Codex.

Pick a model

  • Every model in HeyEly's catalog can answer POST /v1/responses, though models vary in how reliably they handle Codex's structured message format. Start with a coding-focused model like openai/gpt-5.3-codex, and swap models if a session stalls.
  • Override the default model for a single command using codex -m <id>, or switch mid-session with /model.
  • For catalog IDs not built into Codex's registry, Codex falls back to default window sizes. Set model_context_window and model_auto_compact_token_limit at the top level of config.toml to specify exact limits.

Connect the MCP server

Wire up HeyEly's MCP server so Codex can inspect your credit, invoke models inside a budget you define, and mint, rotate, or revoke limited keys after signing in once.

Troubleshooting

You seeCauseFix
stream closed before response.completedThe selected model rejected Codex's request shapeSwitch to another model
Unknown model, fallback metadataCodex does not carry built-in metadata for that catalog IDHarmless warning; Codex falls back to default limits
Config error mentioning wire_apiwire_api was set to the retired "chat" valueChange it to wire_api = "responses"
401 missing_api_keyHEYELY_API_KEY is missing in the shell running CodexExport the variable in that shell and restart Codex
Provider config ignoredPlaced inside a project file or placed under a [table] sectionMove it to ~/.codex/config.toml with top-level keys first
400 citing store or previous_response_idHeyEly's Responses route is statelessKeep store disabled and pass full conversation state
402 insufficient_creditNo credit remaining on the accountAdd credit