> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.pandectes.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to connect ChatGPT and Codex to Pandectes

### Overview

This guide connects ChatGPT or Codex to your store through the Pandectes AI assistants connector. After that you can ask about your cookie banner, your latest cookie scan, your consent rates and your banner languages. The assistant can only read: it can't change settings or see customer data.

All three OpenAI apps sign in the same way: you add the Pandectes connector URL, a **Connect to Pandectes** page opens, and you approve it with your store key.

* **ChatGPT on the web**, through developer mode.
* **The Codex app**.
* **The Codex CLI**.

For what the connector does and how to cut access, see [AI assistants connector: ask Claude or ChatGPT about your privacy setup](/en/article/ai-assistants-connector-1kyulsk/).

### Before you start

* Your Pandectes plan is **Plus** or higher.
* For ChatGPT on the web, your ChatGPT plan must offer developer mode. In a business workspace, an admin may have to allow it.

### Step 1: Generate your store key

1. In Shopify Admin, go to **Apps > Pandectes GDPR Compliance > Integrations**.
2. Open the **AI assistants** tab and click **Set up** on the **ChatGPT (Codex)** card.
3. Under **Store key**, click **Generate key**.
4. Click the eye icon (**Show key**) to see the key, then click **Copy**.

You can show the key for 10 minutes only. After that the page shows just its last four characters, and you need to generate a new one if you lost it.

Keep this page open: you also need the **Connector URL** shown under **Connect ChatGPT (Codex)**.

### Step 2: Add Pandectes to your app

#### ChatGPT on the web

1. In ChatGPT, go to **Settings > Apps > Advanced settings** and turn on **Developer mode**.
2. Click **Create app**.
3. Enter a name, for example `Pandectes`, paste the **Connector URL** and choose **OAuth** for authentication.
4. Save the app. ChatGPT opens the **Connect to Pandectes** page (see Step 3).

#### Codex app

1. In the Codex app, go to **Plugins > MCPs** and click **Add**. In some versions this is under **Settings > MCP servers > Add server**.
2. Choose **Streamable HTTP**.
3. Enter a name, for example `pandectes`, and paste only the **Connector URL**.
4. Leave **Bearer token env var** and the header fields empty.
5. Save, then click **Authenticate**. Codex opens the **Connect to Pandectes** page (see Step 3).

||| Leave **Bearer token env var** empty. That field takes the name of an environment variable, not your key. If you fill it in and the variable isn't set, Codex stops at startup with an error that its configured authentication environment variable is not set, before it reaches Pandectes. With the URL alone, Codex signs in through the Connect to Pandectes page.

#### Codex CLI

1. On the ChatGPT (Codex) page in Pandectes, copy the commands under **Codex CLI**. They already contain your connector URL and look like this:

```bash
codex mcp add pandectes --url CONNECTOR_URL
codex mcp login pandectes
```

2. Run both commands in your terminal. The second one opens the **Connect to Pandectes** page in your browser (see Step 3).

The commands don't include your key. You paste it on the Connect to Pandectes page instead.

### Step 3: Approve the connection

1. On the **Connect to Pandectes** page, paste your key in **Pandectes key**.
2. Click **Approve**.
3. You are sent back to ChatGPT or Codex, and Pandectes shows as connected.

Back in Pandectes, the ChatGPT (Codex) card now shows **Connected**, and the app appears under **Connected assistants**. Pandectes also emails your store's address about the new connection.

You can use the same key for ChatGPT, the Codex app and the Codex CLI. Each one appears as its own connection.

### Step 4: Ask your questions

In ChatGPT, start a new chat in developer mode and select the Pandectes app. In Codex, start a new session. Then ask, for example:

* "Is my cookie banner showing?"
* "How many cookies are uncategorized in my latest scan?"
* "What were my consent rates in the last 30 days?"

### Disconnect ChatGPT or Codex

On the ChatGPT (Codex) page in Pandectes:

* To remove one connection, click **Disconnect** next to it under **Connected assistants** and confirm. Your key keeps working.
* To stop every connection made with the key, click **Revoke key** and confirm.

Removing the app in ChatGPT or Codex (or running `codex mcp remove pandectes`) doesn't revoke the key in Pandectes.

### Troubleshooting

* **Codex stops at startup because an authentication environment variable is not set.** Open the Pandectes server in Codex, clear **Bearer token env var**, save, and click **Authenticate** again.
* **"This key is not valid or was revoked."** Check that you copied the whole key, starting with `pdx_mcp_`. If you generated a new key or revoked it, the old one no longer works: generate a new key and connect again.
* **"Connecting AI assistants needs a paid Pandectes plan (Plus or higher)."** Upgrade your Pandectes plan, then connect again.
* **"This sign-in took too long."** The Connect to Pandectes page waits 15 minutes. Start the connection again from ChatGPT or Codex.
* **"This key can't be shown any more."** The 10 minutes to show the key have passed. Click **Generate new key** and copy the new one. This disconnects anything that used the old key.

### Related articles

* [AI assistants connector: ask Claude or ChatGPT about your privacy setup](/en/article/ai-assistants-connector-1kyulsk/)
* [How to connect Claude to Pandectes](/en/article/how-to-connect-claude-to-pandectes-mly8hj/)
* [How to connect another AI assistant to Pandectes](/en/article/how-to-connect-another-ai-assistant-to-pandectes-axgcq6/)