← all repositories
james-6-23/codex2api

An OpenAI-compatible gateway for your scattered Codex accounts

It pools Codex accounts behind a single OpenAI-compatible gateway so you don't have to manually swap tokens when rate limits hit.

codex2api
Velocity · 7d
+17
★ / day
Trend
accelerating
star history

What it does

Codex2API is a reverse proxy and management layer that sits in front of a pool of Codex accounts. It exposes standard OpenAI-style chat completion, response, image, and model endpoints, plus Anthropic message support, so existing clients like the OpenAI SDK or Claude Code can point at one base URL. Behind the scenes it handles token refresh, account health checks, and request routing.

The interesting bit

The scheduler is the quiet workhorse: it scores accounts by health tier, recent usage, and cooldown status, then picks the next candidate using round_robin or remaining_quota logic. Unhealthy accounts are sidelined automatically instead of spamming you with 429s. The whole thing ships with an embedded React/Vite admin dashboard for account import, proxy pools, an image studio, and usage analytics.

Key highlights

  • Speaks OpenAI (/v1/chat/completions, /v1/responses, /v1/images) and Anthropic (/v1/messages) protocols from one gateway.
  • Account-pool scheduler with health scoring, dynamic concurrency, and rate-limit recovery.
  • Built-in React admin console covering API keys, prompt filtering, image workflows, and per-account usage trends.
  • Runs as a full PostgreSQL/Redis stack or a single-container SQLite deployment with in-memory caching.
  • Tracks per-account USD costs over 5-hour and 7-day windows and supports credit quotas.

Verdict

Worth a look if you are running multiple Codex accounts and want to present them as a single managed API to your tools. Skip it if you only have one account and no need for pooling, scheduling, or usage tracking.

Frequently asked

What is james-6-23/codex2api?
It pools Codex accounts behind a single OpenAI-compatible gateway so you don't have to manually swap tokens when rate limits hit.
Is codex2api open source?
Yes — james-6-23/codex2api is an open-source project tracked on heatdrop.
What language is codex2api written in?
james-6-23/codex2api is primarily written in Go.
How popular is codex2api?
james-6-23/codex2api has 1.8k stars on GitHub and is currently accelerating.
Where can I find codex2api?
james-6-23/codex2api is on GitHub at https://github.com/james-6-23/codex2api.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.