321AI Model MarketplaceLive marketplace →

Connect Codex CLI to 321AI

Coding CLI · configuration guide + live pricing · sign up for trial credit

OpenAI Codex CLI lets you override the model provider in config.toml and point it at the relay.

Codex CLI in one line: Override the provider in ~/.codex/config.toml and export OPENAI_API_KEY. Recommended models and their market floor prices are in the table below; the full catalog is at https://321ai.cc/en/models/.

Sign up & get trial creditSee live pricing

Configuration

SettingValueNotes
base_urlhttps://321ai.cc/v1provider section of ~/.codex/config.toml
env_keyOPENAI_API_KEYthe key is read from this environment variable
modele.g. gpt-6.1-sol

Steps

1. Edit ~/.codex/config.toml and add a custom model_provider pointing at the relay base_url

2. Export OPENAI_API_KEY with your platform key

3. Run codex to verify connectivity

Recommended models (live market floor)

WhatWhereNotes
Live market floor pricinghttps://321ai.cc/en/models/input per 1M tokens, per-supplier quotes on the marketplace

Prices are the multi-supplier market floor and move in realtime; see all model prices →

FAQ

Responses API or Chat Completions?

Depends on the Codex CLI version configuration (the wire_api setting); follow the official docs and the platform's protocol support per model.

Other setup guides

Claude Code Cursor Cherry Studio Cline Dify Immersive Translate LobeChat NextChat Open WebUI Python OpenAI SDK LangChain LiteLLM
All model pricesFeatured · 321AI communityFeatured · Open-source toolsFeatured · Advertise with usFeatured