FIM Gate Docs
Integrations

Codex CLI

Add FIM Gate as a model provider in Codex's config.toml.

Codex is OpenAI's official terminal coding assistant. It lets you define custom model providers in its configuration file — just point one at FIM Gate.

Setup

  1. Install Codex:

    # Homebrew
    brew install codex
    
    # or npm
    npm install -g @openai/codex
  2. Edit the configuration file ~/.codex/config.toml (create it if it doesn't exist):

    # Default model
    model = "gpt-5.2"
    # Default model provider; must match a key under [model_providers.*] below
    model_provider = "fim-gate"
    
    [model_providers.fim-gate]
    # Provider name shown in the Codex UI
    name = "FIM Gate"
    # Endpoint Codex will send requests to
    base_url = "https://api.gate.fim.ai/v1"
    # Name of the environment variable holding your API key; its value is sent as a Bearer token
    env_key = "FIM_API_KEY"
    # Protocol type, either "chat" or "responses"; defaults to "chat" if omitted
    wire_api = "chat"
  3. Set the environment variable (the name must match env_key and the value must not be empty):

    export FIM_API_KEY="key created in the Console at https://api.gate.fim.ai/dashboard"

    Add it to ~/.zshrc or ~/.bashrc to make it persistent.

  4. Start using it:

    # Interactive session
    codex
    
    # One-off question
    codex "Show me how to run the tests in this repo"

You can set model to any available model; for models based on the Responses API, change wire_api to "responses".

On this page