OpenAI Codex CLI Custom Provider: config.toml & Responses API

Configure OpenAI Codex CLI & Desktop with a custom model_provider and Responses API (/v1/responses) for GPT-6.2 Sol ($0.064/1M in) & Astra — no ChatGPT subscription needed.

Modelseed ·
INTERACTIVE CONFIG WIZARD

Generate a ready-to-paste config in 5 seconds

Pick your client, OS, and model — then click below to sign up and auto-fill this exact snippet with a scoped Starter API Key.

# %USERPROFILE%\.codex\config.toml
# Recommended key cap: $2 (2,000 credits)
model = "gpt-6.2-sol"
model_provider = "modelseed"

[model_providers.modelseed]
name = "Modelseed"
base_url = "https://api.modelseed.dev/v1"
wire_api = "responses"
env_key = "MODELSEED_API_KEY"
requires_openai_auth = false

# PowerShell:
$env:MODELSEED_API_KEY = "sk-YOUR_MODELSEED_KEY"
codex
30-SECOND API QUICK START

deepseek-v4-1-flash · Input $0.0822 · Output $0.3289 per 1M tokens

Get key + bonus
from openai import OpenAI
client = OpenAI(base_url="https://api.modelseed.dev/v1", api_key=os.environ["MODELSEED_API_KEY"])
res = client.chat.completions.create(model="deepseek-v4-1-flash", messages=[{"role":"user","content":"Hello!"}])
New accounts get a $1–$2 welcome bonus (1,000–2,000 credits) · Lava, USDT & Binance Pay from 0.50 USDT · DeepSeek rates · Pricing calculator

Why Codex CLI requires wire_api = "responses"

Modern OpenAI Codex CLI and Codex Desktop rely on the OpenAI Responses API (/v1/responses) rather than legacy /v1/chat/completions. Pointing Codex at a gateway that only implements Chat Completions leads to HTTP 404 or broken tool-call streams.

Modelseed supports native Responses API routes across GPT-6.2 Sol, GPT-6.2 Astra, GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Astra with transparent pay-as-you-go USD token billing and no ChatGPT Plus/Pro subscription lock-in.

Published GPT Responses API USD rates on Modelseed (input ≤272K tokens)
Model IDProtocolInput (No Cache)OutputCache Read
gpt-6.2-solResponses API$0.064$0.321$0.0032
gpt-6.2-astraResponses API$0.257$1.283$0.0128
gpt-6.1-terraChat Completions$0.032$0.160$0.0015

Ready-to-paste ~/.codex/config.toml configuration

Add a custom model_provider block in ~/.codex/config.toml (on Windows: %USERPROFILE%\.codex\config.toml) and store your Modelseed API key in the MODELSEED_API_KEY environment variable.

~/.codex/config.toml — Modelseed Responses API provider
model_provider = "modelseed"
model = "gpt-6.2-sol"

[model_providers.modelseed]
name = "Modelseed"
base_url = "https://api.modelseed.dev/v1"
env_key = "MODELSEED_API_KEY"
wire_api = "responses"

Verify your Codex provider before launching large refactors

Run a tiny one-shot prompt first and check that tokens appear cleanly in your Modelseed Usage Logs.

  1. Export MODELSEED_API_KEY in your terminal profile (never hardcode the key inside a committed repository).
  2. Run codex "explain the entry point of this repo in 3 sentences" to verify /v1/responses streaming.
  3. Switch between gpt-6.2-sol (fast, low cost) and gpt-6.2-astra (deeper reasoning) via --model whenever task complexity changes.

Frequently asked questions

Why did Codex return 404 when I tested another base_url?

Most 404s happen because either wire_api = "responses" is missing, the base_url includes an extra /responses suffix, or the gateway does not implement /v1/responses.

Can I use DeepSeek inside Codex CLI through Modelseed?

Check our dedicated DeepSeek in Codex CLI & Claude Code guide to confirm protocol alignment (Responses vs. Chat Completions) before pointing Codex at a non-GPT model.

Do I need a ChatGPT subscription to run Codex CLI via Modelseed?

No. Codex authenticates purely with your Modelseed API key and spends pay-as-you-go USD credits (starting with your $1–$2 free welcome bonus).

Is there an automatic installer for Windows?

Yes — Modelseed Installer configures Codex CLI and Desktop on Windows automatically with a dedicated device key.

Official references

BUILD WITH MODELSEED

From an idea to your first request.

One key and a familiar API. New verified accounts receive a random $1–$2 welcome bonus (1,000–2,000 credits) to test requests before topping up.

Get API key + bonus