Integrate Thesean With Codex

Set up OpenAI Codex CLI to use supported Ship models through Thesean.

Ensure you have your Thesean API key from the Thesean Dashboard before continuing.

Prerequisites

Ensure you have Codex installed. See the Codex quickstart for more options, or use one of the following:

npm install -g @openai/codex

Configuration

Step 1: Store Your API Key

Add your Thesean API key to your shell profile (~/.zshrc, ~/.bashrc, etc.) or a secure location like a .env file:

# Add to ~/.zshrc, ~/.bashrc, etc.
export THESEAN_API_KEY="your-thesean-api-key"

Replace your-thesean-api-key with your actual Thesean API key from the Thesean Dashboard.

Then reload your shell:

source ~/.zshrc  # or source ~/.bashrc etc.

Step 2: Configure the Thesean Provider

Create or edit ~/.codex/config.toml:

Current Codex versions use the Responses API. Thesean's provider must therefore use wire_api = "responses".

[model_providers.thesean-responses]
name = "Thesean /responses"
base_url = "https://api.thesean.ai/v1"
env_key = "THESEAN_API_KEY"
wire_api = "responses"

Step 3: Create Model Profiles

Codex 0.134.0 and later load profiles from separate files. Create one file for each Ship model:

model = "ship-like/gpt-5.6-sol"
model_provider = "thesean-responses"

[features]
multi_agent = false

The provider stays in the shared config.toml; each profile file contains only its model-specific settings. See the Codex profiles documentation and Available Models.

Start Using Codex

Navigate to your project directory and start Codex with a profile:

cd your-project
codex --profile ship-gpt

Codex will now use the selected Ship model through Thesean's /responses endpoint. Switch between the two configured profiles with --profile or the /model command within Codex.


Next Steps

View Available Models

Review supported Ship models and their pricing.

Read more

View Other Integrations

Explore other ways to integrate Thesean with your development workflow.

Read more