XuanShu API
Codex CLI setup
Configure Codex CLI through the OpenAI Responses API and public Base URL.
Last verified:
Connection and authentication
Unified OpenAI-compatible Base URL: https://www.xuanshuapi.com/v1
OpenAI-compatible APIs use Authorization: Bearer <YOUR_API_KEY>; Claude Messages also accepts x-api-key: <YOUR_API_KEY>; Gemini v1beta uses x-goog-api-key: <YOUR_API_KEY>.
# ~/.codex/config.toml
model_provider = "xuanshu"
model = "<MODEL_FROM_CONSOLE>"
[model_providers.xuanshu]
name = "XuanShu API"
base_url = "https://www.xuanshuapi.com/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"
requires_openai_auth = false
# Configure the current shell
export OPENAI_API_KEY="<YOUR_API_KEY>"Codex CLI setup
Back up the existing ~/.codex/config.toml first. Codex uses the Responses API; model and WebSocket availability depend on current console configuration. Rollback by restoring that file and unsetting OPENAI_API_KEY in the current shell.
Models and advanced capabilities depend on the current console configuration.
Next steps
Available models, multipliers, quotas, and some advanced capabilities depend on the current key and console configuration.