Status: [LIVE] Endpoints found: https://openrouter.ai/api/v1/chat/completions https://openrouter.ai/api/v1/chat Source: https://github.com/MrFant/responses-chat-proxy # responses-chat-proxy > Proxy converting OpenAI **Responses API** to **Chat Completions API** for use with [Codex CLI](https://github.com/openai/codex) and third-party LLM providers. ## Why? Codex CLI (v0.125+) only uses the Responses API (`/v1/responses`). Most third-party LLM providers (Ollama, vLLM, MiMo, local models, etc.) only support Chat Completions (`/v1/chat/completions`). This proxy bridges the gap. ``` Codex CLI ──Responses API──▶ [Proxy] ──Chat Completions──▶ Any Provider ``` ## Quick Start ```bash # Install pip install -e . # Run (point to your Chat Completions backend) BACKEND_URL=http://localhost:11434/v1/chat/completions responses-chat-proxy # Or with API key BACKEND_URL=http://your-provider/v1/chat/completions \ BACKEND_API_KEY=sk-... \ responses-chat-proxy ``` ## Codex Configuration Add to `~/.codex/config.toml`: ```toml [model_providers.chat-proxy] name = "chat-proxy" base_url = "http://127.0.0.1:8765/v1" wire_api = "responses" [profiles.proxy] model_provider = "chat-proxy" ``` Then run Codex with the proxy profile: ```bash codex -p proxy "your prompt here" ``` Or set environment variables: ```bash OPENAI_BASE_URL=http://127.0.0.1:8765/v1 codex -p proxy "your prompt" ``` ## Configuration | Environment Variable | Default | Description | |---|---|---| | `BACKEND_URL` | **required** | Upstream Chat Completions endpoint | | `BACKEND_API_KEY` | *(empty)* | API key for upstream provider | | `PORT` | `8765` | Port to listen on | | `LOG_LEVEL` | `info` | Log level (debug/info/warning/error) | ## Examples ### With Ollama ```bash BACKEND_URL=http://localhost:11434/v1/chat/completions responses-chat-proxy ``` ### With vLLM ```bash BACKEND_URL=http://localhost:8000/v1/chat/completions responses-chat-proxy ``` ### With OpenRouter (if they don't support Responses API for your model) ```bash BACKEND_URL=https://openrouter.ai/api/v1/chat/completions \ BACKEND_API_KEY=sk-or-... \ responses-chat-proxy ``` ### With any