start_within. The deadline goes on the key instead. Create one first (see agent keys).
Set this up with an agent
Open the block below and copy it into any coding agent. The prompt never asks for your API key: the agent configures everything else, then prints the one export line for you to run yourself.Copy agent setup prompt
Copy agent setup prompt
Configure Codex
Codex keeps each profile in its own file. This profile leaves your usual Codex setup alone, and you opt in per run with--profile.
- Write the profile file. Paste this once:
- Export the key Codex reads. The profile file never holds it.
- Start Codex with the profile.
/v1/responses, sends the key as a bearer token, and the key supplies the deadline. The session header names the provider in use, so you can see the profile took.
To reach us on every Codex run instead, put the same lines in ~/.codex/config.toml. The top-level model and model_provider there set your default.
env_key and auth rule each other out. env_key reads the key from your environment, which is the short path. Keep secrets in a keychain instead and you leave env_key out, then name a helper command in auth.
Keep the model line. Codex otherwise defaults to a slug ending in -codex, which we hold no price for and never race. Use the full gpt-5.6-sol, because the bare gpt-5.6 alias makes Codex print a metadata warning.
Confirm the key applied
Every response comes withx-flexinference-defaults-applied. Codex doesn’t show response headers, so read the request in the dashboard under Logs instead.
Troubleshooting
Nothing reaches us at all. You ran a plaincodex, which uses your usual provider and account. Start it with --profile flexinference. Any error you saw is theirs, usage limits included, and the session header names the provider in use.
400 model_not_priced_for_managed. model is unset, so the request arrived on a -codex slug we hold no price for. Set model = "gpt-5.6-sol" in the profile. On your own provider key we run that slug instead, with no cost figure of ours.
400 service_tier_not_allowed. The profile sets service_tier, and we read the tier from the deadline instead. Remove the line.
400 key_default_not_applicable naming a pinned route. The request pins a cloud route such as foundry, which has no cheap tier to race. Remove the pinned route, or edit the key to a tier.
Every request spends a full retry budget. Codex has its own request_max_retries, and a key retry policy stacks with it. Set one or the other, not both.
The cursor sits waiting. Flex race costs less and starts later, which you feel in an interactive loop. Edit the key’s deadline to Priority or Standard. The next request picks it up with no restart.
See errors for every refusal we return, and agent keys for the ones that are not specific to Codex.