{"repo": "aguero1234/codex-deepseek-proxy", "files": {".env.example": {"52983924816b0010cec0221d90b2787996ef447c": {"t": 1785745130.5502846, "n": 279, "h": "5d5fa1d1835e974c", "c": "# DeepSeek API Key (required)\nDEEPSEEK_API_KEY=sk-your-key-here\n\n# Optional: API base URL (default: https://api.deepseek.com/v1)\nDEEPSEEK_API_BASE=https://api.deepseek.com/v1\n\n# Optional: Proxy port (default: 18888)\nPROXY_PORT=18888\n\n# Optional: Enable debug logging\nDEBUG=false\n"}, "2a14450256c7f1eb44679270a1ad7daeab28e11d": {"t": 1785748049.059858, "n": 279, "h": "5d5fa1d1835e974c", "c": "# DeepSeek API Key (required)\nDEEPSEEK_API_KEY=sk-your-key-here\n\n# Optional: API base URL (default: https://api.deepseek.com/v1)\nDEEPSEEK_API_BASE=https://api.deepseek.com/v1\n\n# Optional: Proxy port (default: 18888)\nPROXY_PORT=18888\n\n# Optional: Enable debug logging\nDEBUG=false\n"}}, "README.md": {"52983924816b0010cec0221d90b2787996ef447c": {"t": 1785747288.052659, "n": 1995, "h": "684ed432c11dc55b", "c": "# codex-deepseek-proxy\n\n> A lightweight proxy that bridges OpenAI Codex CLI with the DeepSeek API.\n> Translates Codex's `/v1/responses` format to DeepSeek's `/v1/chat/completions` — with SSE streaming support.\n\n## The Problem\n\nCodex CLI expects the OpenAI Responses API (`/v1/responses`), but DeepSeek uses the Chat Completions API (`/v1/chat/completions`). They're not compatible.\n\n## The Solution\n\n```\nCodex CLI → localhost:18888 → [proxy translates format] → DeepSeek API\n```\n\nThis proxy:\n1. Receives Codex's Responses API requests\n2. Converts them to Chat Completions format\n3. Forwards to DeepSeek\n4. Converts the response back (including SSE streaming)\n5. Returns to Codex\n\n## Quick Start\n\n```bash\n# Set your DeepSeek API key\nexport DEEPSEEK_API_KEY=\"sk-your-key-here\"\n\n# Run the proxy\npython proxy.py\n\n# In another terminal, configure Codex CLI\ncodex --api-base http://127.0.0.1:18888/v1\n```\n\nThat's it. Codex will now use DeepSeek as its backend.\n\n## Features\n\n- **Full SSE streaming** — real-time token-by-token output\n- **Tool call support** — translates function calling between formats\n- **Zero dependencies** — pure Python stdlib, no pip install needed\n- **Lightweight** — single file, ~300 lines\n\n## Configuration\n\n| Env Variable | Default | Description |\n|---|---|---|\n| `DEEPSEEK_API_KEY` | Required | Your DeepSeek API key |\n| `DEEPSEEK_API_BASE` | `https://api.deepseek.com/v1` | DeepSeek API base URL |\n| `PROXY_PORT` | `18888` | Local proxy port |\n| `DEBUG` | `false` | Enable request logging |\n\n## How It Works\n\n```\nCodex sends:\n POST /v1/responses { model, input, instructions, stream, tools }\n\nProxy converts to:\n POST /v1/chat/completions { model, messages, stream, tools }\n\nDeepSeek responds:\n SSE stream with deltas\n\nProxy converts back to:\n SSE events: response.output_text.delta → response.completed\n```\n\n## Use with Codex CLI config\n\nAdd to `~/.codex/config.toml`:\n\n```toml\nmodel = \"deepseek-chat\"\napi_base_url = \"http://127.0.0.1:18888/v1\"\n```\n\n## License\n\nMIT\n"}, "5d95e22ac009ead5e46d53b06850e72b69218ec1": {"t": 1785748048.9513702, "n": 1995, "h": "684ed432c11dc55b", "c": "# codex-deepseek-proxy\n\n> A lightweight proxy that bridges OpenAI Codex CLI with the DeepSeek API.\n> Translates Codex's `/v1/responses` format to DeepSeek's `/v1/chat/completions` — with SSE streaming support.\n\n## The Problem\n\nCodex CLI expects the OpenAI Responses API (`/v1/responses`), but DeepSeek uses the Chat Completions API (`/v1/chat/completions`). They're not compatible.\n\n## The Solution\n\n```\nCodex CLI → localhost:18888 → [proxy translates format] → DeepSeek API\n```\n\nThis proxy:\n1. Receives Codex's Responses API requests\n2. Converts them to Chat Completions format\n3. Forwards to DeepSeek\n4. Converts the response back (including SSE streaming)\n5. Returns to Codex\n\n## Quick Start\n\n```bash\n# Set your DeepSeek API key\nexport DEEPSEEK_API_KEY=\"sk-your-key-here\"\n\n# Run the proxy\npython proxy.py\n\n# In another terminal, configure Codex CLI\ncodex --api-base http://127.0.0.1:18888/v1\n```\n\nThat's it. Codex will now use DeepSeek as its backend.\n\n## Features\n\n- **Full SSE streaming** — real-time token-by-token output\n- **Tool call support** — translates function calling between formats\n- **Zero dependencies** — pure Python stdlib, no pip install needed\n- **Lightweight** — single file, ~300 lines\n\n## Configuration\n\n| Env Variable | Default | Description |\n|---|---|---|\n| `DEEPSEEK_API_KEY` | Required | Your DeepSeek API key |\n| `DEEPSEEK_API_BASE` | `https://api.deepseek.com/v1` | DeepSeek API base URL |\n| `PROXY_PORT` | `18888` | Local proxy port |\n| `DEBUG` | `false` | Enable request logging |\n\n## How It Works\n\n```\nCodex sends:\n POST /v1/responses { model, input, instructions, stream, tools }\n\nProxy converts to:\n POST /v1/chat/completions { model, messages, stream, tools }\n\nDeepSeek responds:\n SSE stream with deltas\n\nProxy converts back to:\n SSE events: response.output_text.delta → response.completed\n```\n\n## Use with Codex CLI config\n\nAdd to `~/.codex/config.toml`:\n\n```toml\nmodel = \"deepseek-chat\"\napi_base_url = \"http://127.0.0.1:18888/v1\"\n```\n\n## License\n\nMIT\n"}}}}