For the complete documentation index, see llms.txt. This page is also available as Markdown.

Codex CLI

Integrating Codex CLI with FastRouter.

What is Codex CLI

Codex CLI is OpenAI's open-source local coding agent that runs in your terminal. It supports multiple model providers, including FastRouter, allowing you to leverage FastRouter's unified API gateway, provider failover, unified observability, BYOK (Bring Your Own Key) support, and organizational controls while using Codex's agentic coding workflows.

1. Install Codex CLI

Start by installing Codex CLI on your local machine. Follow the installation instructions for your operating system.

npm install -g @openai/codex
# provide fastrouter api key by following steps 2 and 3
codex --version

2. Create a FastRouter account

Sign up or log in to your FastRouter account to access models through FastRouter's unified AI gateway.

3. Generate a FastRouter API key

  1. Navigate to API Keys (keys page).

  2. Create a new API key.

  3. Copy and securely store your API key.

4. Configure Codex CLI to use FastRouter

4.1. Edit the config file

Edit the ~/.codex/config.toml file to connect to FastRouter:

4.2. Export your FastRouter API key

Export the API key in your terminal:

4.3. Start Codex

5. Codex core settings reference

Codex supports project-level trust settings. Define project paths to control which directories and resources the agent can access.

  • trusted — Agent can freely access and modify the project, including running commands and editing files.

  • untrusted — Agent operates with limited permissions and requires additional approval for sensitive actions.

6. Alternative: install Codex CLI with FastRouter

One-line install script

In the commands below, replace $API_KEY with your actual FastRouter API key.

Or download, inspect, then run:

Install Codex with the FastRouter skill file

Install using skill.md:

Or ask Codex to install FastRouter:

7. Why use Codex CLI with FastRouter

Configure Codex CLI to use your FastRouter API key and endpoint. Once configured, you can access models through FastRouter and take advantage of:

Unified API — Access models from multiple AI providers through a single, consistent API interface.

Provider failover & routing — Automatically route requests to available providers and fail over during outages or rate limits.

Unified observability — Monitor requests, latency, costs, and usage across all providers from a centralized dashboard.

Troubleshooting — Debug API requests, authentication, routing, and provider responses faster with FastRouter's audit logs.

BYOK (Bring Your Own Key) — Use your own provider API keys while maintaining centralized routing and management.

Organization controls — Manage organizations, projects, keys, and API usage with enterprise-grade governance controls.

8. References

You can find the skill.md file attached below, or at https://fastrouter.ai/codex/skill.md.


Last updated