Skip to main content
FireConnect routes the OpenAI Codex CLI through Fireworks AI models via the Responses API. See the FireConnect overview for install and CLI basics.

Prerequisites

Fire Pass keys (fpk_...) are not supported for Codex yet. The /responses endpoint requires a standard Fireworks API key.

Enable Fireworks routing

Or pass the key once:
After fireconnect codex on or off, config.toml is updated immediately. To use updated routing, exit Codex and resume with codex resume <id>, or start a new session.

Default model

Codex routes a single default model. The default is glm-fast-latest.

What gets written

FireConnect edits ~/.codex/config.toml:
  • Sets root model_provider / model for Codex 0.134+ (stored as a short slug)
  • Adds a [model_providers.fireworks-ai] block with wire_api = "responses" and a baked experimental_bearer_token literal (file mode 0600). Codex reads the key from config; no shell hook is required.
FireConnect snapshots your original ~/.codex/config.toml before the first change. The snapshot lives in ~/.fireconnect/codex/. Running fireconnect codex off restores it byte-for-byte. Unrelated Codex settings (for example [[mcp_servers]]) are preserved via surgical TOML edits.

Codex model catalog

When you run fireconnect codex on, FireConnect fetches your account’s serverless catalog and writes Codex-compatible model metadata to ~/.codex/fireworks-model-catalog.json. It links that file from config.toml via model_catalog_json so Codex knows display names, context windows, reasoning levels, and tool-calling support for each model.
The catalog includes serverless models that support tool calling with a non-zero context window, plus curated aliases such as glm-fast-latest. Deprecated models are excluded. If catalog generation fails (for example, due to an invalid API key), routing still works but Codex may show limited model metadata until you re-run fireconnect codex on. Browse available models globally:

FireRouter

Route requests through FireRouter:
FireRouter requires a standard Fireworks API key (fw_...). FireConnect rejects --model firerouter with Fire Pass keys on every harness. For Codex, FireRouter BYOK reads ANTHROPIC_API_KEY from your shell at runtime. Pass --anthropic-api-key on on, run fireconnect configure --anthropic-api-key sk-ant-..., or export the key before starting Codex.
MiniMax models are not supported in Codex. Codex uses the Fireworks Responses API and may insert assistant messages between tool_calls and tool_results. MiniMax chat templates require tool_results to follow tool_calls directly. Use Chat Completions harnesses (for example Claude Code or OpenCode) for MiniMax.

CLI reference

Run fireconnect codex help for all options.

Switch models

Some models expose multiple reasoning levels in the Codex catalog (for example, glm-5p2 supports high and max). Pick the model in Codex with /model after switching.

Turn off Fireworks routing

This restores your previous config.toml from the backup in ~/.fireconnect/codex/.

Use a non-default config file

Fireworks on Microsoft Foundry

Codex supports Fireworks on Microsoft Foundry (CLI: --provider azure or on --azure). See the FireConnect overview and Microsoft Foundry integration guide for portal setup.
Foundry routing requires a standard Azure API key. Fire Pass keys (fpk_...) are not supported. FireConnect does not write a Fireworks model catalog on the Foundry path. Set your deployment with --model.

Configure and enable

One-off routing:

What gets written

FireConnect sets model_provider = "fireworks-azure" in config.toml with a Fireworks on Microsoft Foundry provider block pointed at your Foundry endpoint. The Azure API key is baked as a literal when passed with --api-key, or referenced via env_key = "AZURE_API_KEY" when resolved from the environment. Pass your Foundry model with --model (for example, FW-GLM-5.2). Use fireconnect model list only for browsing Fireworks serverless models on the direct gateway path.

Turn off Foundry routing

To switch back to the Fireworks gateway:
To remove FireConnect entirely and restore your original config.toml:
See Turn off Foundry routing for details on global config behavior and uninstall.

Source

FireConnect is open source: github.com/fw-ai/fireconnect