[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81458":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},81458,"cli","codeproxy-ai\u002Fcli","codeproxy-ai","@codeproxy\u002Fcli is a local proxy server that converts any Chat Completions or Anthropic Messages API into the OpenAI Responses API format. It lets Codex, Claude Code, or any Responses-API client use models from DeepSeek, GLM, Kimi, and more.","",null,"TypeScript",41,3,1,0,4,6,10,12,50.81,false,"main",[24,25,26,27,28],"claude-code","codex","deepseek","glm","kimi","2026-06-12 04:01:33","# @codeproxy\u002Fcli\n\n> **中文版** → [README.zh-CN.md](.\u002FREADME.zh-CN.md)\n\n**@codeproxy\u002Fcli** is a local proxy server that converts **any** Chat Completions or Anthropic Messages API into the **OpenAI Responses API** format. It lets Codex, Claude Code, or any Responses-API client use models from DeepSeek, GLM, Kimi, and more.\n\nBuilt on [@codeproxy\u002Fcore](https:\u002F\u002Fgithub.com\u002Fcodeproxy-ai\u002Fcore).\n\n## Quick Start\n\n```bash\nnpx @codeproxy\u002Fcli --base-url https:\u002F\u002Fapi.deepseek.com\u002Fv1 \\\n  --model deepseek-v4-flash \\\n  --apikey sk-your-key\n```\n\nPoint your Responses-API client at `http:\u002F\u002F127.0.0.1:8787`:\n\n```bash\ncurl -N http:\u002F\u002F127.0.0.1:8787\u002Fv1\u002Fresponses \\\n  -H 'content-type: application\u002Fjson' \\\n  -d '{\"input\":\"Hello!\",\"stream\":true}'\n```\n\n### With config file\n\n```bash\nnpx @codeproxy\u002Fcli --config .\u002Fconfig.json\n```\n\nSee [config.example.json](.\u002Fconfig.example.json) for a full example.\n\n#### Top-level fields\n\n| Field | Type | Description |\n|---|---|---|\n| `version` | `string` | Config format version (currently `\"1.0\"`) |\n| `currentUpstream` | `string` | Name of the upstream to use (must match a key in `upstreams`) |\n| `headers` | `object` | Default headers applied to **all** upstreams (merged with per-upstream headers; per-upstream wins) |\n| `reasoningEffort` | `string` | Default reasoning effort for all upstreams: `\"low\"`, `\"medium\"`, `\"high\"`, `\"xhigh\"` |\n| `thinking` | object or null | Default thinking config for all upstreams. Anthropic format: `{\"type\": \"enabled\", \"budget_tokens\": 16384}`. Set to `null` to disable |\n| `timeoutMs` | `number` | Default upstream request timeout in milliseconds |\n\n#### Per-upstream fields\n\n| Field | Type | Description |\n|---|---|---|\n| `baseUrl` | `string` | **Required.** Upstream endpoint URL |\n| `apiKey` | `string` | Upstream API key. Sent as `Authorization: Bearer \u003Ckey>` (Anthropic: rewritten to `x-api-key`) |\n| `model` | `string` | Override the `model` field in all incoming requests |\n| `modelAliases` | `object` | Rewrite only matching incoming model names. Unmapped models pass through unchanged |\n| `apiVersion` | `string` | Override `anthropic-version` header (Anthropic only) |\n| `headers` | `object` | Extra HTTP headers for this upstream. Merged on top of top-level `headers`, per-upstream wins |\n| `dropImages` | `boolean` | When `true`, strip image\u002Ffile parts from user messages (for text-only models). Use with `fallback` to auto-route image requests to a vision-capable upstream |\n| `fallback` | `string` | Name of another upstream to route to when `dropImages: true` and the request contains images |\n| `reasoningEffort` | `string` | Per-upstream reasoning effort override (`\"low\"`, `\"medium\"`, `\"high\"`, `\"xhigh\"`). Overrides top-level value |\n| `thinking` | object or null | Per-upstream thinking config. Overrides top-level value. Set to `null` to disable |\n\n#### Precedence\n\n```\nCLI flags > per-upstream fields > top-level fields > built-in defaults\n```\n\n#### Example: auto-fallback for text-only models\n\nWhen `deepseek` has `dropImages: true` and the user sends an image, the proxy automatically routes to `kimi`:\n\n```json\n{\n  \"currentUpstream\": \"deepseek\",\n  \"upstreams\": {\n    \"deepseek\": {\n      \"baseUrl\": \"https:\u002F\u002Fapi.deepseek.com\u002Fv1\",\n      \"apiKey\": \"sk-...\",\n      \"model\": \"deepseek-v4-flash\",\n      \"modelAliases\": {\n        \"gpt-5.5\": \"deepseek-v4-flash\",\n        \"gpt-4o\": \"deepseek-v4-flash\"\n      },\n      \"dropImages\": true,\n      \"fallback\": \"kimi\"\n    },\n    \"kimi\": {\n      \"baseUrl\": \"https:\u002F\u002Fapi.kimi.com\u002Fcoding\u002Fv1\",\n      \"apiKey\": \"sk-kimi-...\",\n      \"model\": \"kimi-for-coding\",\n      \"headers\": { \"user-agent\": \"KimiCLI\u002F1.39.0\" }\n    }\n  }\n}\n```\n\n## Codex Configuration\n\nCodex `0.128.0+` requires custom providers to speak the Responses API. `@codeproxy\u002Fcli` bridges this gap for any Chat Completions or Anthropic Messages upstream.\n\n### Quick setup\n\n1. Start the proxy:\n\n```bash\nnpx @codeproxy\u002Fcli --base-url https:\u002F\u002Fapi.deepseek.com\u002Fv1 \\\n  --model deepseek-v4-flash \\\n  --apikey sk-your-key\n```\n\n2. Add a custom provider in `~\u002F.codex\u002Fconfig.toml`:\n\n```toml\n[model_providers.deepseek]\nname = \"DeepSeek\"\nbase_url = \"http:\u002F\u002F127.0.0.1:8787\u002Fv1\"\nwire_api = \"responses\"\n\n[profiles.deepseek-pro]\nmodel = \"deepseek-v4-flash\"\nmodel_provider = \"deepseek\"\n```\n\n### Multiple upstreams via config file\n\n```json\n{\n  \"currentUpstream\": \"deepseek-chat\",\n  \"upstreams\": {\n    \"deepseek-chat\": {\n      \"baseUrl\": \"https:\u002F\u002Fapi.deepseek.com\u002Fv1\",\n      \"apiKey\": \"sk-...\",\n      \"model\": \"deepseek-v4-flash\",\n      \"dropImages\": true,\n      \"fallback\": \"kimi\"\n    },\n    \"kimi\": {\n      \"baseUrl\": \"https:\u002F\u002Fapi.kimi.com\u002Fcoding\u002Fv1\",\n      \"apiKey\": \"sk-kimi-...\",\n      \"model\": \"kimi-for-coding\",\n      \"headers\": { \"user-agent\": \"KimiCLI\u002F1.39.0\" }\n    },\n    \"claude\": {\n      \"baseUrl\": \"https:\u002F\u002Fapi.anthropic.com\u002Fv1\",\n      \"apiKey\": \"sk-ant-...\",\n      \"model\": \"claude-sonnet-4-20250514\"\n    }\n  }\n}\n```\n\nSwitch upstreams by changing `currentUpstream` and restarting the proxy — no Codex config changes needed.\n\n## Install\n\n```bash\nnpm install -g @codeproxy\u002Fcli\n```\n\n## CLI Options\n\n| Flag | Default | Description |\n|---|---|---|\n| `--base-url \u003Curl>` | — | Upstream endpoint (required unless `--config`) |\n| `--upstream-format \u003Cfmt>` | inferred | `anthropic` or `openai-chat` |\n| `--config \u003Cfile>` | — | JSON config file |\n| `--host \u003Chost>` | `127.0.0.1` | Bind host |\n| `-p, --port \u003Cport>` | `8787` | Bind port |\n| `--api-version \u003Cver>` | `2023-06-01` | Override Anthropic version header |\n| `--apikey \u003Ckey>` | — | Upstream API key |\n| `--model \u003Cname>` | — | Override model for all requests |\n| `--drop-images` | — | Strip images (text-only models) |\n\n## Programmatic usage\n\n```ts\nimport { createResponsesFetch, startProxy } from '@codeproxy\u002Fcli';\n\nconst proxy = await startProxy({\n  upstreamFormat: 'openai-chat',\n  baseUrl: 'https:\u002F\u002Fapi.deepseek.com\u002Fv1',\n  defaultHeaders: { authorization: 'Bearer sk-...' },\n});\n```\n\n## License\n\nMIT\n","@codeproxy\u002Fcli 是一个本地代理服务器，可将任何聊天完成或Anthropic消息API转换为OpenAI响应API格式，使得Codex、Claude Code或其他响应API客户端能够使用来自DeepSeek、GLM、Kimi等的模型。其核心功能包括通过配置文件灵活设置上游服务参数（如API密钥、模型名称等），并支持自定义请求头和超时设置。此外，它还允许用户为文本模型自动移除图片部分，并将包含图像的请求路由到具有视觉能力的上游服务。此项目适用于需要跨不同AI平台进行开发或测试的场景，特别是当开发者希望利用非OpenAI提供的模型但仍偏好使用OpenAI API格式时。",2,"2026-06-11 04:05:09","CREATED_QUERY"]