inf claude, inf codex, inf grok, inf opencode, or inf pi to route a local coding agent through Inference.net. Use off to restore its previous configuration.
These commands change the coding agent’s model traffic. inf instrument changes an application’s LLM clients for observability.
Quick start
1
Install or update the CLI
2
Sign in
3
Connect one agent
How it works
on writes the gateway URL, key, and model selection to the agent’s config. It also records which fields inf owns.
status reports whether the agent is routed through Inference.net and whether you changed any owned field since on.
off restores owned fields unless you changed them after on.
Model mapping
The CLI writes one of three catalog aliases. Every alias supports tool calling.
Claude Code maps six slots to Anthropic tier names.
Codex, Grok, OpenCode, and Pi have no tier system. They default to
kimi-k3-fast and take a single --model <alias> flag. OpenCode and Pi register all three aliases in their provider registry, so you can switch models inside the harness without re-running on. Grok registers one section per alias (inference-glm-5.2-fast, inference-kimi-k3-fast, inference-deepseek-v4-flash-0731). Codex sets the root model key.
The gateway serves Claude Code on its native Anthropic surface (/v1/messages). It serves the other agents on the OpenAI-compatible surface (https://api.inference.net/v1): Responses for Codex, chat completions for Grok, OpenCode, and Pi.
Gateway key and authentication
inf <agent> on needs a gateway key. It resolves one in this order:
INFERENCE_API_KEYenvironment variable (never persisted).- The project key stored by
inf auth set-key. - A coding-agent key minted on a previous run (stored in
~/.inf/config.json). - If none of the above, an authenticated session mints one project-scoped key.
inf saves a minted key to ~/.inf/config.json. This prevents an interrupted on from losing the key. The server stores only its hash, so the local file is the only copy of the raw value.
Coding-agent commands do not take an --api-key flag. Secrets never travel through argv, shell history, or process listings. --json and human output show only a masked preview (inf_sk_a...9f2c), never the raw key.
See Authentication for session and API key details. See Troubleshooting to revoke a key.
Safe reversal
inf owns specific fields, not the whole config file. On the first on, it records each original value. off restores a field only when its current value matches a value that inf wrote. It leaves your later edits in place.
status reports drift per field:
active: the field matches whatinfwrote.modified: you changed it sinceon.missing: you deleted it.
inf <agent> off to revert. Restart the agent after on or off.
An upgrade does not change an existing connection. Re-run inf <agent> on to apply new defaults. off can still restore the values from before your first on.
See Troubleshooting for the full conflict table and the moved-config-directory case.
Choose an agent
Claude Code
~/.claude/settings.jsonCodex
~/.codex/config.toml and $CODEX_HOME/.envGrok
~/.grok/config.tomlOpenCode
~/.config/opencode/opencode.jsonPi
~/.pi/agent/models.json and settings.jsonTroubleshooting
Drift, keys, logout, and the model map