Native macOS tray app for a local Codex reverse proxy.
The proxy exposes OpenAI-compatible local endpoints and forwards requests to the Codex upstream used by the Codex CLI:
GET /v1/modelsPOST /v1/responsesPOST /v1/responses/compactPOST /v1/chat/completionsPOST /v1/completions
It also exposes Anthropic-compatible endpoints at the root base URL for Claude Code:
GET /v1/modelsPOST /v1/messagesPOST /v1/messages/count_tokensGET /health
The implementation is Swift/AppKit for the tray UI and Swift/Foundation plus
Network.framework for the local HTTP proxy. CLIProxyAPI/ is kept only as a
local reference and is ignored by git.
just runOpen the tray menu and choose Login OpenAI to run the Codex OAuth flow in
the browser. The app receives the callback at /auth/callback, stores the
access/refresh token in its local settings, and refreshes OAuth tokens before
expiry.
You can also choose Settings and set an upstream Codex access token manually.
By default the proxy listens on:
http://127.0.0.1:1455/v1
Use that /v1 URL as the OpenAI-compatible base URL. Claude Code uses the root
base URL instead:
http://127.0.0.1:1455
If Token is empty, the proxy falls back to the incoming
Authorization: Bearer <token> header. If Proxy Key is set, requests must use
that key locally and a separate upstream Token must be configured.
The OAuth flow follows the Codex CLI-style PKCE flow used by CLIProxyAPI:
- authorization endpoint:
https://auth.openai.com/oauth/authorize - token endpoint:
https://auth.openai.com/oauth/token - redirect:
http://localhost:1455/auth/callbackby default - scope:
openid email profile offline_access
GET /v1/models fetches the current account's available models from the Codex
upstream on every request. Set Codex Client Version in the Settings window,
then choose Save & Refresh Models to apply that version immediately and view
the account's current model list. Anthropic clients are detected from Anthropic headers or Claude
Code user agents and receive the Anthropic models shape; other clients receive
the OpenAI models shape. Requests to inference endpoints must specify a model;
the proxy does not substitute a stale local fallback.
The tray menu includes a Live Models submenu with the latest fetched model IDs,
and Copy Claude Code Config, which copies shell environment variables for
launching Claude Code against the root local proxy URL.
Claude Code uses the Anthropic Messages API; the proxy translates /v1/messages
into the Codex upstream /responses protocol and translates Codex responses
back to Anthropic message events.
just app
open CodexAPI.appThe generated app bundle is a menu-bar-only app (LSUIElement=true) and is not
tracked by git.
just is the project build entrypoint:
just test # run tests
just release # build the release binary
just app # build CodexAPI.app
just open-app # build and open CodexAPI.app
just package # create dist/CodexAPI-1.0.1-macos.zip
just clean # remove generated artifacts