> ## Documentation Index
> Fetch the complete documentation index at: https://docs-vip.apigo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI

> Use models provided through ApiGo in Codex CLI for AI coding.

## Install Codex CLI

Install Codex CLI globally with `npm`:

```bash theme={null}
# Version 0.57.0 is recommended
npm i -g @openai/codex@0.57.0
```

## Configure ApiGo API

> **Important: clear OpenAI environment variables before use**
>
> Before configuring, clear the following OpenAI-related environment variables so they do not override your ApiGo settings:
>
> * `OPENAI_BASE_URL`
> * `OPENAI_API_KEY`

## Choose an integration method

<Tabs>
  <Tab title="Manual configuration ">
    1. Edit Codex's config file at `.codex/config.toml` and add:

    ```toml theme={null}
    [model_providers.apigo]
    name = "Chat Completions API"
    base_url = "https://api-vip.apigo.ai/v1"
    env_key = "APIGO_API_KEY"
    wire_api = "chat"
    requires_openai_auth = false
    request_max_retries = 4
    stream_max_retries = 10
    stream_idle_timeout_ms = 300000

    [profiles.apigo]
    model = "gpt-5.4"
    model_provider = "apigo"
    ```

    2. Set `APIGO_API_KEY` to your platform key.
    3. Launch Codex CLI with the configured profile:

    ```bash theme={null}
    codex --profile apigo
    ```
  </Tab>
</Tabs>
