# Connect OpenAI Codex (UI)

This guide walks you through connecting OpenAI Codex to your Genie server using the dashboard UI. Once connected, Genie uses your ChatGPT account to power AI interactions.

***

## Prerequisites

* A Genie account with a running server
* An OpenAI account with a ChatGPT subscription

***

## Step 1: Open LLM Integrations

Go to your Genie dashboard → **Settings** → **Server**. Scroll down to **LLM Integrations** and select the **Codex** tab. Click **Connect Codex CLI**.

![Server settings showing LLM Integrations with Codex tab](https://253630326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy3wRNrxvvjTFreyXSBOV%2Fuploads%2Fgit-blob-e781a9b58b282f3139bd00ed705d49fc95e54a0b%2Fcodex-ui-server-settings.png?alt=media)

***

## Step 2: Sign In to OpenAI

A new tab opens to the OpenAI login page. Enter your email and password, or use one of the social login options (Google, Apple, Microsoft).

![OpenAI login page](https://253630326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy3wRNrxvvjTFreyXSBOV%2Fuploads%2Fgit-blob-3fa25cc45bc276fb1bfecfdb9550b61901884a38%2Fcodex-ui-openai-login.png?alt=media)

***

## Step 3: Authorize Codex

After signing in, you will see a consent page. This explains that Codex will be linked to your ChatGPT account and will use your plan's rate limits. Click **Continue**.

![Codex authorization consent page](https://253630326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy3wRNrxvvjTFreyXSBOV%2Fuploads%2Fgit-blob-42eb99aac158d6cbac9af6e129f79508d4bfe3b7%2Fcodex-ui-consent.png?alt=media)

***

## Step 4: Copy the Callback URL

Your browser redirects to a `localhost` URL. This will show a **connection error** — this is expected on remote servers.

Copy the **full URL** from your browser's address bar. It contains the authorization code needed to complete the setup.

![Browser showing localhost connection error — copy the full URL](https://253630326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy3wRNrxvvjTFreyXSBOV%2Fuploads%2Fgit-blob-d5643b70c9165e76bd9b4e13bec6fa1716f3a33a%2Fcodex-ui-callback-error.png?alt=media)

***

## Step 5: Paste the URL in Genie

Go back to the Genie settings tab. Paste the callback URL into the input field and click **Connect**.

![Paste callback URL and click Connect](https://253630326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy3wRNrxvvjTFreyXSBOV%2Fuploads%2Fgit-blob-4dadb2dca78ac620be41554f37d6edb08e7119f0%2Fcodex-ui-paste-url.png?alt=media)

***

## Step 6: Connected

All steps show green checkmarks. You will see the message: **"Codex CLI connected — your server is ready!"**

![Successful Codex connection with all green checkmarks](https://253630326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy3wRNrxvvjTFreyXSBOV%2Fuploads%2Fgit-blob-5121c21a4bbef9a4df81c65cf4340cf09f6dd30c%2Fcodex-ui-success.png?alt=media)

Your server is now using OpenAI Codex for AI interactions.

***

## Tips

* The localhost connection error in Step 4 is expected — just copy the URL from the address bar
* Codex uses your ChatGPT plan's rate limits and training preferences
* You can also set up Codex via the terminal — see [Set Up OpenAI Codex](https://docs.deva.me/guides/openai-codex-setup)
* To verify the connection, go to Chat and send a message to Genie
