Status: [UNTESTED] Endpoints found: http://localhost:8000/v1/responses Source: https://github.com/talkcozy/api2codex # api2codex > [中文文档](README_CN.md) A lightweight proxy that converts the **OpenAI Responses API** (`/v1/responses`) into the **Chat Completions API** (`/v1/chat/completions`) and converts responses back — enabling tools like [OpenAI Codex](https://github.com/openai/codex) to work with **any** Chat Completions compatible API provider. ## Why? OpenAI Codex CLI (v0.130+) uses the Responses API (`wire_api = "responses"`) internally. Most third-party API providers and self-hosted proxies only support the Chat Completions API. This proxy sits in between and translates in real-time: ``` ┌────────────┐ Responses API ┌────────────┐ Chat Completions ┌────────────┐ │ Codex │ ──────────────────>│ api2codex │ ────────────────────>│ Any LLM │ │ CLI │ <──────────────────│ proxy │ <────────────────────│ Provider │ └────────────┘ (SSE stream) └────────────┘ (SSE stream) └────────────┘ ``` ## Features - **Streaming & non-streaming** support - **Function calling / tool use** — full round-trip including multi-turn tool conversations - **Reasoning content** — forwards `reasoning_content` (thinking/reasoning tokens) - **Developer role mapping** — maps Responses API `developer` role to Chat Completions `system` role - **Multi-part content** — handles text + image inputs - **Zero dependencies beyond Python** — just FastAPI, uvicorn, and httpx - **Single file** — easy to understand, modify, and deploy ## Quick Start ### 1. Install ```bash pip install fastapi uvicorn httpx ``` Or with [uv](https://github.com/astral-sh/uv): ```bash uv pip install fastapi uvicorn httpx ``` ###