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

# Codex

> This documentation is provided for informational purposes only and demonstrates how to configure and use our API with third-party AI chat interfaces. Any third-party software, websites, or services mentioned are not operated, controlled, or endorsed by us.

# **Introduction to Codex**

<Frame>
  <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-69.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=92335ea0b6e9a8a5c6b74ffbc81da2bd" alt="Image" width="1600" height="900" data-path="images/image-69.webp" />
</Frame>

[Codex](https://github.com/openai/codex) is OpenAI’s coding agent for software development. ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex. It can help you:

**Codex** Key Features:

* **Write code**: Describe what you want to build, and Codex generates code that matches your intent, adapting to your existing project structure and conventions.
* **Understand unfamiliar codebases**: Codex can read and explain complex or legacy code, helping you grasp how teams organize systems.
* **Review code**: Codex analyzes code to identify potential bugs, logic errors, and unhandled edge cases.
* **Debug and fix problems**: When something breaks, Codex helps trace failures, diagnose root causes, and suggest targeted fixes.
* **Automate development tasks**: Codex can run repetitive workflows such as refactoring, testing, migrations, and setup tasks so you can focus on higher-level engineering work.

# **Step**

<Steps>
  <Step title="Install Codex">
    <Tip>
      Need a one-click configuration tool? Try [x6.ai Starter](https://x6.ai), officially released by x6.ai.
    </Tip>

    <Tabs>
      <Tab title="CLI - Node.js">
        You can **manually** install Node.js and the corresponding coding agent:

        Install [the newest LTS version of Node.js](https://nodejs.org/en/download/).

        After installation is complete, open the terminal (Windows users use PowerShell) and check the version number.

        * macOS, Linux, Windows:

        ```shellscript theme={null}
        npm i -g @openai/codex
        ```

        Verify the installation.

        ```shellscript theme={null}
        codex --version
        ```

        If the version number is displayed correctly, the installation is successful.
      </Tab>

      <Tab title="App">
        The Codex app is available on macOS and Windows.

        Please follow [the tutorial](https://developers.openai.com/codex/app#getting-started) to complete the installation.
      </Tab>

      <Tab title="VS Code Extension">
        **Install** the [**Codex Code extension**](https://marketplace.visualstudio.com/items?itemName=openai.chatgpt) from the [**VS Code**](https://code.visualstudio.com/download) Marketplace — Codex is OpenAI’s coding agent that helps you write, review, and ship code faster. Use it side-by-side in your IDE or delegate larger tasks to the cloud.

        <Frame>
          <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-93.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=983094a9b4944a5228abd11429c7f590" alt="Image" width="983" height="258" data-path="images/image-93.webp" />
        </Frame>
      </Tab>
    </Tabs>
  </Step>

  <Step title="Install Codex">
    <Tip>
      Need a one-click configuration tool? Try [x6.ai Starter](https://x6.ai), officially released by x6.ai.
    </Tip>

    <Tabs>
      <Tab title="CLI - Node.js">
        You can **manually** install Node.js and the corresponding coding agent:

        Install [the newest LTS version of Node.js](https://nodejs.org/en/download/).

        After installation is complete, open the terminal (Windows users use PowerShell) and check the version number.

        * macOS, Linux, Windows:

        ```shellscript theme={null}
        npm i -g @openai/codex
        ```

        Verify the installation.

        ```shellscript theme={null}
        codex --version
        ```

        If the version number is displayed correctly, the installation is successful.
      </Tab>

      <Tab title="App">
        The Codex app is available on macOS and Windows.

        Please follow [the tutorial](https://developers.openai.com/codex/app#getting-started) to complete the installation.
      </Tab>

      <Tab title="VS Code Extension">
        **Install** the [**Codex Code extension**](https://marketplace.visualstudio.com/items?itemName=openai.chatgpt) from the [**VS Code**](https://code.visualstudio.com/download) Marketplace — Codex is OpenAI’s coding agent that helps you write, review, and ship code faster. Use it side-by-side in your IDE or delegate larger tasks to the cloud.

        <Frame>
          <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-93.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=983094a9b4944a5228abd11429c7f590" alt="Image" width="983" height="258" data-path="images/image-93.webp" />
        </Frame>
      </Tab>
    </Tabs>
  </Step>

  <Step title="Configure Codex">
    Codex uses the `config.toml` file to parse provider parameters. Please locate and create/edit this file according to your operating system.

    **Edit or create** `config.toml` file

    On macOS & Linux: `~/.codex/config.toml`

    On Windows: `C:\Users\<USERNAME>\.codex\config.toml`

    Delete the previous content and replace it with the following.Configuration file:

    ```shellscript theme={null}
    model_provider = "custom"
    model = "gpt-5.6-sol"
    model_reasoning_effort = "high"
    disable_response_storage = true

    [model_providers.custom]
    name = "custom"
    wire_api = "responses"
    base_url = "https://api.x6.ai/v1"
    ```

    You can replace the "model" field with any [model](https://x6.ai/models) that is compatible with the OpenAI format:

    <Frame>
      <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-92.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=ef9f3c656edfaf3e9ab3efcaa88b089b" alt="Image" width="1180" height="913" data-path="images/image-92.webp" />
    </Frame>

    Next, **edit or create** `auth.json` file. Codex uses this file to read the API key.

    On macOS & Linux: `~/.codex/auth.json`

    On Windows: `C:\Users\<USERNAME>\.codex\auth.json`

    Make sure to replace `<X6_API_KEY>` with your API key from [x6.ai](https://x6.ai/settings/api-keys). When replacing it, do not keep the angle brackets `<` and `>`.

    ```json theme={null}
    {
      "OPENAI_API_KEY": "<X6_API_KEY>"
    }
    ```
  </Step>

  <Step title="Codex Loading and Validation">
    <Tabs>
      <Tab title="CLI">
        > Windows users may encounter issues running the software due to missing VC runtime libraries. Please download and install [this software](https://aka.ms/vs/17/release/vc_redist.x64.exe).

        Navigate to your code working directory and run the `codex` command in the terminal

        ```shellscript theme={null}
        codex
        ```

        Select "Yes" to trust this folder.

        <Frame>
          <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/image-71.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=03971e51dfc76e92a296e5c59ea6d33e" alt="Image" width="1126" height="276" data-path="images/image-71.webp" />
        </Frame>

        Now you can use Codex CLI.
      </Tab>

      <Tab title="App">
        Open Codex App. If prompted to choose, select “sign in with your OpenAI API key” and enter your API key from [x6.ai](https://x6.ai/settings/api-keys).

        Now you can use Codex App.

        <Frame>
          <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/img_v3_0211f_cb906c37-5e8d-4c44-bed3-bce56b67e8hu.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=7f76b9010fc4d063382d7dffc32439e3" alt="Img V3 0211f Cb906c37 5e8d 4c44 Bed3 Bce56b67e8hu" width="1600" height="1025" data-path="images/img_v3_0211f_cb906c37-5e8d-4c44-bed3-bce56b67e8hu.webp" />
        </Frame>
      </Tab>

      <Tab title="VS Code Extension">
        Click the **Toggle Chat** button at the top (shortcut: `Ctrl+Alt+I`), then click **Codex**.

        <Frame>
          <img src="https://mintcdn.com/x6/el_h-gJpYp66h95k/images/1.webp?fit=max&auto=format&n=el_h-gJpYp66h95k&q=85&s=d11b018a0bd2753621eba55f0d8f54ac" alt="1" width="1360" height="940" data-path="images/1.webp" />
        </Frame>

        Done! You can now use Codex for VS Code.
      </Tab>
    </Tabs>
  </Step>
</Steps>
