Turn your Codex subscription into a local API in one click

Save official Codex or third-party upstreams as clovapi profiles; after switch, the local proxy routes OpenAI Responses traffic to the real endpoint.

OpenAI Codex CLI expects the official Responses API by default. If you want to keep the Codex workflow while pointing traffic at a self-hosted gateway, team proxy, or shared profile library across agents, hand-editing ~/.codex/config.toml often leaves half-finished config behind.

Why Codex still needs a local proxy

Codex is tied to the openai-responses format, not generic Chat Completions. Many gateways only speak /v1/chat/completions; changing the base URL alone usually breaks on tool calls or streaming fields. When you run switch --cli codex, clovapi:

  1. Merges Codex config.toml (provider, model, experimental bearer, and related keys).
  2. Starts the built-in local proxy so Codex only talks to localhost.
  3. Transcodes and forwards Responses-shaped requests to the profile you saved.

The agent keeps stable paths; switching upstream means switching a clovapi profile.

Suggested commands

npm i -g @clovapi/cli
clovapi add --name codex-official
clovapi switch --cli codex codex-official

add probes connectivity first. For a third-party gateway, enter base URL, API key, and model ID in the interactive flow. Official subscription and vendor APIs are distinguished by profile name:

clovapi switch --cli codex my-gateway

Share the profile library with Claude Code

profiles.json stores upstreams, not per-CLI silos. You might keep deepseek for Claude Code and openrouter-prod for Codex, each applied with switch. The desktop app and CLI read the same file—pick profiles in the GUI or automate in the terminal.

Read more