Native OpenAI Responses API · Codex CLI & Desktop Ready · No Rate Walls

Codex CLI & API,pay per token.

Full native support for OpenAI Responses (/v1/responses), reasoning effort controls, and automatic prefix caching — connect Codex CLI or Desktop in seconds without a $200/month subscription.

  • ¥5 Free Trial Credit on Signup
  • Native wire_api = "responses"
  • Automatic Cached-Input Discounts
  • One-Click Toolkit & Script Setup

Sign Up & Claim ¥5 Credit · View all live GPT / Codex prices →

Live GPT / Codex groups,clear discounts.

Pick a "Codex Only" group for the lowest rate inside Codex CLI/Desktop, or choose an "External / Official" group when reusing the same key in Cursor, OpenClaw, Cherry Studio or backend services.

Prices shown in RMB per 1M tokens (official USD list rates converted at $1 = ¥7) · See every OpenAI / Codex model & tier on the Pricing page →

Codex API vs ChatGPT plans:compare real costs.

Hitting Plus rate limits in Codex CLI, yet hesitant to lock into $200/month for Pro? Here is how pay-as-you-go stacks up:

ZhenAPI Codex Pay-As-You-Go (Best Value)

From ¥1 · Never-expiring RMB pool · Multi-key support — Pay a few RMB on light bug-fix days and scale freely during heavy refactors

  • Light-to-moderate daily coding with cached inputs typically costs ¥2–¥8/day
  • Share one RMB balance across Codex, Claude Code, Gemini and DeepSeek
  • Run parallel Codex tasks without hitting single-seat subscription throttles
  • 0%-surcharge corporate wire transfers (≥¥1,000) with Digital VAT invoices

ChatGPT Plus (Entry Plan)

$20 / mo · ~¥145 / month recurring — Good for web chat, but rolling quotas tighten quickly on large repositories

  • Multi-file repository tasks can exhaust CLI quota windows mid-sprint
  • Requires overseas card billing and risks account region flags
  • Locked to OpenAI models — requires separate subscriptions for Claude

ChatGPT Pro (Power Plan)

$200 / mo · ~¥1,450 / month recurring — Equivalent to hundreds of millions of discounted Codex tokens every month

  • Most individual developers and small teams spend far less than ¥1,450/mo per-token
  • Single-user seat cannot be split into per-engineer API keys with hard caps
  • Pooling team spend on ZhenAPI stretches the same budget across multiple developers

Two settings that guarantee a clean Codex CLI setup

Modern Codex CLI speaks the OpenAI Responses API rather than legacy Chat Completions. ZhenAPI supports streaming tool calls, reasoning summaries and prefix caching natively:

  • Include /v1 in base_url: Set base_url = "https://api.zhenapi.ai/v1" (unlike Claude Code, Codex requires /v1)
  • Set wire_api = "responses": Declare wire_api = "responses" under [model_providers.zhenapi] in ~/.codex/config.toml
  • Automatic Cached Input: Repeated repo context prefixes automatically receive cached-input discounts

Configure Codex CLI & Desktop in 3 steps

Generate an sk-... key bound to a Codex / OpenAI group on the API Keys page, then run a one-click installer or Toolkit to write ~/.codex/config.toml (existing files are backed up to .bak):

macOS / Linux / WSL Script

Backs up ~/.codex/config.toml, writes the ZhenAPI Responses provider, and optionally installs Codex CLI:

curl -fsSL https://zhenapi.ai/install/codex.sh | bash

Windows PowerShell Script

Wait for the API key prompt, then right-click in PowerShell to paste your full sk-... key and press Enter:

irm https://zhenapi.ai/install/codex.ps1 | iex

Manual ~/.codex/config.toml

Place top-level model_provider and model BEFORE any [table] header and set experimental_bearer_token to your ZhenAPI key (works for both Codex CLI and Desktop):

model_provider = "zhenapi"
model = "gpt-6.2-sol"
model_reasoning_effort = "high"
model_context_window = 272000
sandbox_mode = "workspace-write"

[model_providers.zhenapi]
name = "ZhenAPI"
base_url = "https://api.zhenapi.ai/v1"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
experimental_bearer_token = "sk-your-zhenapi-key"
http_headers = { "x-openai-actor-authorization" = "zhenapi.ai" }

[desktop]
conversationDetailMode = "STEPS_COMMANDS"

[sandbox_workspace_write]
network_access = true

[features]
goals = true

Download Windows Toolkit ↓ · Toolkit Guide → · Switch profiles with CC Switch → · Full Codex Setup Docs

Codex API FAQ & Troubleshooting

Why does codex still prompt me to sign in with an OpenAI account after editing config.toml?

In TOML, top-level keys (model_provider = "zhenapi") must appear above every [section] header; placing them below a header nests them inside that table. Also ensure requires_openai_auth = false and experimental_bearer_token are set under [model_providers.zhenapi]. Running the one-click script or ZhenAPI Toolkit writes a clean UTF-8 config automatically.

Why am I getting 404 Not Found in Codex?

Verify that base_url ends with /v1 (https://api.zhenapi.ai/v1) and that the configured model name exists in your key’s assigned channel group on /en/pricing.

Should I choose "Codex (Codex Only)" or "Codex Pro (External)"?

Choose "Codex (Codex Only)" for the deepest discount inside official Codex CLI and Desktop. Choose "Codex Pro (External)" or "GPT Official" when reusing the key in Cursor, OpenClaw, Cherry Studio, or custom backend code.

Do failed requests (401 / 403 / 429 / 502) deduct balance?

No. Failed requests are never charged. Successful calls bill strictly by actual input, cached-input, and output tokens multiplied by your group rate, auditable in real time under Usage.

Do you support corporate bank transfers and Chinese VAT invoices for team Codex usage?

Yes. Corporate bank transfers of ¥1,000+ waive the 5% invoicing surcharge for 1:1 Chinese Digital VAT General Invoices, and commitments of ¥3,000+ support formal framework contracts. See /en/enterprise.

Enterprise Procurement & VAT →