|
1 | | -# Codex2API |
2 | | - |
3 | | -[中文](README.md) | [English](README_EN.md) |
4 | | - |
5 | | -Codex2API is a **Go + Gin + React/Vite** Codex reverse proxy and admin dashboard. It supports: |
6 | | - |
7 | | -- Standard mode: **PostgreSQL + Redis** |
8 | | -- Lightweight mode: **SQLite + in-memory cache** |
9 | | - |
10 | | -It exposes OpenAI-style API endpoints and manages a long-running account pool based on Refresh Tokens, with token refresh, account scheduling, testing, rate-limit recovery, usage tracking, image generation, prompt filtering, and admin operations built in. |
| 1 | +<p align="center"> |
| 2 | + <img src="assets/banner.svg" alt="Codex2API" width="100%"> |
| 3 | +</p> |
| 4 | + |
| 5 | +<p align="center"> |
| 6 | + <a href="README.md"><img src="https://img.shields.io/badge/Lang-%E4%B8%AD%E6%96%87-red?style=for-the-badge" alt="中文"></a> |
| 7 | + <a href="README_EN.md"><img src="https://img.shields.io/badge/Lang-English-blue?style=for-the-badge" alt="English"></a> |
| 8 | + <img src="https://img.shields.io/badge/Go-1.26-00ADD8?style=for-the-badge&logo=go&logoColor=white" alt="Go"> |
| 9 | + <img src="https://img.shields.io/badge/Gin-1.12-00ACD7?style=for-the-badge" alt="Gin"> |
| 10 | + <img src="https://img.shields.io/badge/React-19-61DAFB?style=for-the-badge&logo=react&logoColor=111827" alt="React"> |
| 11 | + <img src="https://img.shields.io/badge/Vite-8-646CFF?style=for-the-badge&logo=vite&logoColor=white" alt="Vite"> |
| 12 | + <img src="https://img.shields.io/badge/DB-PostgreSQL%20%7C%20SQLite-4169E1?style=for-the-badge&logo=postgresql&logoColor=white" alt="Database"> |
| 13 | + <img src="https://img.shields.io/badge/Cache-Redis%20%7C%20Memory-DC382D?style=for-the-badge&logo=redis&logoColor=white" alt="Cache"> |
| 14 | + <img src="https://img.shields.io/badge/API-OpenAI%20%7C%20Anthropic-10A37F?style=for-the-badge" alt="API"> |
| 15 | + <img src="https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker&logoColor=white" alt="Docker"> |
| 16 | +</p> |
| 17 | + |
| 18 | +**Turn a Codex account pool into an observable, schedulable, operations-ready OpenAI / Anthropic compatible gateway.** Codex2API is not a thin forwarding proxy. It is a long-running Codex access hub: it exposes `/v1/chat/completions`, `/v1/responses`, `/v1/messages`, Images, and Models endpoints while managing Refresh Token / Access Token accounts, health scoring, dynamic concurrency, rate-limit recovery, usage tracking, and admin operations behind the scenes. |
| 19 | + |
| 20 | +Run it as a full **PostgreSQL + Redis** production stack or as a single-container **SQLite + in-memory cache** deployment. Point Codex CLI, Claude Code, the OpenAI SDK, or any compatible client at one Base URL, then manage accounts, proxies, API keys, prompt filtering, image workflows, and runtime settings from the built-in dashboard. |
| 21 | + |
| 22 | +<table> |
| 23 | +<tr><td width="210"><b>One compatible gateway</b></td><td>OpenAI-style Chat Completions / Responses / Images, Anthropic Messages, prefixless compatibility routes, and native Codex Responses forwarding are all exposed through one service.</td></tr> |
| 24 | +<tr><td><b>Account-pool scheduler</b></td><td>Selection is driven by account status, health tier, scheduler score, dynamic concurrency, cooldown recovery, and recent usage so unhealthy accounts are avoided automatically.</td></tr> |
| 25 | +<tr><td><b>Visual admin console</b></td><td>The embedded React / Vite dashboard covers account import and testing, API keys, proxy pools, image studio, prompt filtering, usage analytics, operations, scheduler board, and system settings.</td></tr> |
| 26 | +<tr><td><b>Two deployment shapes</b></td><td>Use PostgreSQL + Redis for production or SQLite + Memory for lightweight single-node deployments; Docker images, source builds, local development, and the interactive deploy script are ready to use.</td></tr> |
| 27 | +</table> |
11 | 28 |
|
12 | 29 | --- |
13 | 30 |
|
|
0 commit comments