---
title: "Connect OpenAI Codex CLI to Straitly | Straitly Docs"
description: "Point OpenAI Codex CLI at https://api.straitly.ai/v1 to run GPT and frontier coding models through Straitly."
url: https://straitly.ai/docs/codex
updated: 2026-11-25
publisher: Straitly (https://straitly.ai)
---

Docs

Connect your tools

# Connect Codex

Copy docs

**On this page**

Use your Straitly key in the Codex app and the Codex CLI. One paste sets up both, and the models you pick show up in Codex’s model menu. Works on Mac, Linux and Windows.

App + CLI setup

Have ready

The Codex app or CLI installed. On Mac and Linux, curl and python3 in your terminal. On Windows, only PowerShell, which every Windows 10 and 11 machine has. The screenshots follow macOS.

What changes

The Straitly connection in \~/.codex/config.toml and your model list in \~/.codex/straitly-models.json (on Windows, in %USERPROFILE%\\.codex).

Keep copied keys and setup commands private.

### Before you start

The command in step 3 creates a key for you, or uses one you already have. You need the Codex app or the Codex CLI installed.

### Setup

Mac or Linux Windows

#### 1. Pick your models

These are the models you will see in Codex. The first one is picked when it opens.

Claude Opus 5.5× GPT-6.1 Sol× Claude Fable 5.2×

- Claude Sonnet 5.5 Anthropic · $1.20 / $6 Add
- GLM-5.3 Z.ai · $0.42 / $1.39 Add
- DeepSeek V4.1 Flash 1017 DeepSeek · $0.090 / $0.36 Add

Price per million tokens, input / output. Only models that can run Codex are listed.

#### 2. Open a terminal

Press **⌘ Space**, type **Terminal** and press **Enter**.

![Spotlight search with Terminal selected](https://straitly.ai/shots/claude-code/1-terminal.webp?v=a012c851)

#### 3. Paste the command

Copy it, paste it into Terminal and press **Enter**. You should see `Done - Codex now uses Straitly.`

Copy command Show command

It adds Straitly to `~/.codex/config.toml` and keeps everything else in it, and writes your model list to `~/.codex/straitly-models.json`.

![Terminal after pasting the command, showing Done - Codex now uses Straitly](https://straitly.ai/shots/codex/1-done.webp?v=7f577e31)

#### 4. Restart Codex and start a new chat

Quit Codex with **⌘ Q** and open it again, then click **New chat**. Chats started before the paste stay on the old models. The model name at the bottom right is now one of yours.

![The Codex app on a new chat with Claude Opus 5.5 selected](https://straitly.ai/shots/codex/2-home.webp?v=5077d90b)

#### 5. Pick a model

Click the model name at the bottom right. The slider sets how hard the model thinks. Click the model name above the slider to see your list.

![The Codex thinking level slider set to High for Claude Opus 5.5](https://straitly.ai/shots/codex/3-effort.webp?v=e5c19065)

#### 6. Send a message

Say anything. If Codex answers, you are done.

### Codex in the terminal

The same paste sets up the CLI. Type `codex` and press **Enter**, then type `/model` to switch models.

### Change your models later

Pick again in step 1 and paste the new command. It replaces the list. Restart Codex afterwards. Every id is on the [models page](https://straitly.ai/models).

### Verify your connection

Restart Codex and start a new chat. Choose a model from your list and send a short message, then check Straitly Activity.

[Open request activity](https://straitly.ai/app/activity) to check the model, status, and charge for your test request.

### Setup checks

**A chat still uses the old model**

Create a new chat after restarting Codex. Chats that were started before setup keep their previous model settings.

**The command stops before Done**

Read the terminal error before continuing. Confirm Codex is installed and, on Mac or Linux, that curl and python3 are available, then retry the setup command. On Windows, use the Windows command, not the Mac one.

If the request is rejected, check your balance and key limits in [Errors & limits](https://straitly.ai/docs/errors).

### Undo

The first paste saves a copy of your old settings. To go back, run:

bash

Copy Copied Failed

cp ~/.codex/config.toml.before-straitly ~/.codex/config.toml

If you had no Codex settings before, delete `~/.codex/config.toml` instead. Then restart Codex.

[Connect Claude app](https://straitly.ai/docs/claude-app) [Connect OpenCode](https://straitly.ai/docs/opencode)

---
Markdown version of https://straitly.ai/docs/codex.
