Connect an agent
Coding Agents
Codex
Route OpenAI Codex through the Inference.net gateway with inf codex.
inf codex routes Codex through https://api.inference.net/v1 using the OpenAI Responses surface. Codex resolves provider credentials through an env var name, so the key lives in $CODEX_HOME/.env, not inline in the config.
Config files
inf writes fields in ~/.codex/config.toml (TOML) and $CODEX_HOME/.env. Both honor CODEX_HOME. inf owns fields in both files, not the whole files.
inf codex on
inf codex on| Flag | Required | Description | Default |
|---|---|---|---|
--model <alias> | No | Model alias written as the root model | kimi-k3-fast |
See Model mapping for supported aliases and limits.
What gets written
TOML owned fields in config.toml:
| Path | Value |
|---|---|
model | selected alias |
model_provider | inference |
[model_providers.inference].name | Inference.net |
[model_providers.inference].base_url | https://api.inference.net/v1 |
[model_providers.inference].env_key | INFERENCE_API_KEY |
[model_providers.inference].wire_api | responses |
.env owned line:
| Path | Value |
|---|---|
INFERENCE_API_KEY | gateway key (secret) |
model = "kimi-k3-fast"
model_provider = "inference"
[model_providers.inference]
name = "Inference.net"
base_url = "https://api.inference.net/v1"
env_key = "INFERENCE_API_KEY"
wire_api = "responses"inf codex status
inf codex statusinf codex off
inf codex offoff restores unchanged owned fields. It keeps fields that you edited after on.
Examples
Select the Fast-tier alias:
inf codex on --model glm-5.2-fastRestart Codex after on or off. See Troubleshooting for drift, recovery, and key revocation.