Skip to content

About

Connect OpenAI Codex CLI to Crazyrouter using a custom Responses API provider. Windows, macOS and Linux setup guides.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Crazyrouter Codex CLI

Practical guides / 实操入口

Run OpenAI Codex CLI through Crazyrouter with a clean one-command setup for Windows, macOS, and Linux.

English · 简体中文 · 日本語 · Русский

OpenAI Compatible Codex CLI Windows macOS Linux License


兼容性核对 · 2026-10-12

Codex 使用 Responses API。启动前必须在 config.toml 中同时配置 provider 表与顶层 model_provider,仅设置环境变量不会选择自定义 provider。gpt-5.6-sol 已于 2026-10-12 通过最小 Responses 请求。模型出现在目录或支持 Chat Completions 不等于 Claude、Gemini、DeepSeek、Qwen 兼容 Codex。

OpenAI gateway configuration

Project In Four Languages

Language Introduction
中文 本项目帮助你把 OpenAI Codex CLI 快速连接到 Crazyrouter,并通过 Crazyrouter 的 OpenAI-compatible API 调用支持的模型。
日本語 OpenAI Codex CLI を Crazyrouter に接続し、Crazyrouter の OpenAI-compatible API 経由で対応モデルを利用できます。
Русский Проект помогает подключить OpenAI Codex CLI к Crazyrouter и использовать модели Crazyrouter через OpenAI-совместимый API.
English Connect OpenAI Codex CLI to Crazyrouter, then use Crazyrouter-supported models through an OpenAI-compatible API.

Choose Your Guide

Language Full guide
English README.en.md
简体中文 README.zh-CN.md
日本語 README.ja.md
Русский README.ru.md

What You Get

Need Included file or flow
Windows installer install-crazyrouter-codex.ps1
Windows double-click entry install-crazyrouter-codex.bat
macOS / Linux installer install-crazyrouter-codex.sh
Existing Codex CLI users Switch mode, config backup, Crazyrouter provider rewrite
New users Full setup for Git, Node.js, Codex CLI, environment variables, test project

The scripts write a consistent OpenAI-compatible Base URL:

https://cn.crazyrouter.com/v1

Do not add UTM parameters to API endpoints. UTM parameters are only for links opened by people.


Fast Start

Existing Codex CLI, Switch To Crazyrouter

Windows PowerShell:

$env:CRAZYROUTER_CODEX_MODE='switch'; iwr -UseB https://raw.githubusercontent.com/xujfcn/crazyrouter-codex-cli/main/install-crazyrouter-codex.ps1 | iex

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-codex-cli/main/install-crazyrouter-codex.sh | bash -s -- --switch

New Machine, Full Setup

Windows PowerShell:

iwr -UseB https://raw.githubusercontent.com/xujfcn/crazyrouter-codex-cli/main/install-crazyrouter-codex.ps1 | iex

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/xujfcn/crazyrouter-codex-cli/main/install-crazyrouter-codex.sh | bash

Configuration Written By The Scripts

The scripts ask for your Crazyrouter API key and preferred model, then configure:

OPENAI_API_KEY=your-crazyrouter-api-key
OPENAI_BASE_URL=https://cn.crazyrouter.com/v1

They also write a Codex provider block similar to:

model = "gpt-5.6-sol"
model_provider = "crazyrouter"

[model_providers.crazyrouter]
name = "Crazyrouter"
base_url = "https://cn.crazyrouter.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "responses"

Codex CLI options can change between versions. After installation, run:

codex --help

Important Notes

  • Keep /v1 in the Base URL.
  • Do not use tracking parameters in OPENAI_BASE_URL.
  • Node.js 22+ is recommended for Codex CLI.
  • Model availability depends on your Crazyrouter account, enabled routes, and upstream model status.
  • If the script finds an existing Codex config, it creates a timestamped backup first.

Useful Links


License

MIT

About

Connect OpenAI Codex CLI to Crazyrouter using a custom Responses API provider. Windows, macOS and Linux setup guides.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages