APIKO
Option 2 · Manual setup

Codex CLI

Use OpenAI Codex CLI with APIKO GPT models over the Responses API

Overview

Codex CLI is OpenAI's command-line coding agent. It talks to models through the OpenAI Responses API, which APIKO serves for the GPT models in the catalog. Add APIKO as a custom model provider and pick one of the GPT models verified with Codex CLI in Step 2.

Prerequisites

Step 1: Install Codex CLI

bash
npm install -g @openai/codex

Verify the installation:

bash
codex --version

Step 2: Configure APIKO API

Save your key in an environment variable:

bash
export APIKO_API_KEY="your-apiko-api-key"

Add the export line to ~/.zshrc or ~/.bashrc to keep it; on Windows the SetEnvironmentVariable line keeps it for new terminals. Then edit or create ~/.codex/config.toml (Windows: %USERPROFILE%\.codex\config.toml):

toml
model = "gpt-6-sol"
model_provider = "apiko"

[model_providers.apiko]
name = "APIKO"
base_url = "https://api.apiko.app/v1"
env_key = "APIKO_API_KEY"
wire_api = "responses"

Set model to a model verified with Codex CLI: gpt-6.1-sol, gpt-6-astra, gpt-6-sol, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna or gpt-5.4-mini. To use Claude models, we recommend Claude Code CLI or OpenCode.

Codex's /model list comes from the catalog bundled with Codex, not from APIKO, so a newly released model is listed only after you update Codex; the model set in config.toml is used either way. gpt-6.1-sol is listed from Codex 0.160.0; update with npm i -g @openai/codex@latest.

Step 3: Verify Configuration

bash
codex exec --skip-git-repo-check "Reply with the word ok"

--skip-git-repo-check lets the check run outside a git repository. A short reply means the provider is working. A 401 means the key in APIKO_API_KEY is missing or wrong; a 400 or model error means the model value is not a model your key can call (check GET /v1/models).