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
- Create an API key in Developers and export it as
HEYELY_API_KEYin the shell where you launch Codex. - Add the HeyEly provider block to
~/.codex/config.toml(or%USERPROFILE%\on Windows). Make sure the top-level keys stay above the first. codex\ config. toml [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"
- 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_providerormodel_providersinside a project's.codex/config.tomltriggers a startup warning and is ignored. - Provider names
openai,ollama, andlmstudioare reserved; pick any other identifier such asheyely. wire_api = "responses"is required and is the only supported wire format.modelmust match an exact catalog ID from Models.HEYELY_API_KEYmust 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
- Run
codex doctorto validate your install, config file, and auth setup. - Launch
codexand run/statusto confirm the active provider and model. - Send
Reply.with exactly: gateway-ok - 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 likeopenai/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_windowandmodel_at the top level ofauto_ compact_ token_ limit config.tomlto 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 see | Cause | Fix |
|---|---|---|
stream | The selected model rejected Codex's request shape | Switch to another model |
Unknown | Codex does not carry built-in metadata for that catalog ID | Harmless warning; Codex falls back to default limits |
Config error mentioning wire_api | wire_api was set to the retired "chat" value | Change it to wire_api = "responses" |
401 missing_api_key | HEYELY_API_KEY is missing in the shell running Codex | Export the variable in that shell and restart Codex |
| Provider config ignored | Placed inside a project file or placed under a [table] section | Move it to ~/.codex/config.toml with top-level keys first |
400 citing store or previous_response_id | HeyEly's Responses route is stateless | Keep store disabled and pass full conversation state |
402 insufficient_credit | No credit remaining on the account | Add credit |