{"id":30141876,"url":"https://github.com/glidea/claude-worker-proxy","last_synced_at":"2025-08-11T05:20:18.066Z","repository":{"id":309039644,"uuid":"1031614403","full_name":"glidea/claude-worker-proxy","owner":"glidea","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-09T11:43:02.000Z","size":77,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-09T13:23:33.184Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/glidea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://afdian.com/a/glidea"}},"created_at":"2025-08-04T04:36:04.000Z","updated_at":"2025-08-09T11:43:57.000Z","dependencies_parsed_at":"2025-08-09T13:23:34.806Z","dependency_job_id":"edaef740-ddac-4b94-a828-357626e55f29","html_url":"https://github.com/glidea/claude-worker-proxy","commit_stats":null,"previous_names":["glidea/claude-to-x"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/glidea/claude-worker-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glidea%2Fclaude-worker-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glidea%2Fclaude-worker-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glidea%2Fclaude-worker-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glidea%2Fclaude-worker-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glidea","download_url":"https://codeload.github.com/glidea/claude-worker-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glidea%2Fclaude-worker-proxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269833310,"owners_count":24482423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-11T05:20:17.351Z","updated_at":"2025-08-11T05:20:18.049Z","avatar_url":"https://github.com/glidea.png","language":"TypeScript","funding_links":["https://afdian.com/a/glidea"],"categories":[],"sub_categories":[],"readme":"把各家（Gemini，OpenAI）的模型 API 转换成 Claude 格式提供服务\n\n## 特性\n\n- 🚀 一键部署到 Cloudflare Workers\n- 🔄 兼容 Claude Code。配合 [One-Balance](https://github.com/glidea/one-balance) 低成本，0 费用使用 Claude Code\n- 📡 支持流式和非流式响应\n- 🛠️ 支持工具调用\n- 🎯 零配置，开箱即用\n\n## 快速部署\n\n```bash\ngit clone https://github.com/glidea/claude-worker-proxy\ncd claude-worker-proxy\nnpm install\nwrangler login # 如果尚未安装：npm i -g wrangler@latest\nnpm run deploycf\n```\n\n## 使用方法\n\n```bash\n# 例子：以 Claude 格式请求 Gemini 后端\ncurl -X POST https://claude-worker-proxy.xxxx.workers.dev/gemini/https://generativelanguage.googleapis.com/v1beta/v1/messages \\\n  -H \"x-api-key: YOUR_GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"gemini-2.5-flash\",\n    \"messages\": [\n      {\"role\": \"user\", \"content\": \"Hello\"}\n    ]\n  }'\n```\n\n### 参数说明\n\n- URL 格式：`{worker_url}/{type}/{provider_url_with_version}/v1/messages`\n- `type`: 目标厂商类型，目前支持 `gemini`, `openai`\n- `provider_url_with_version`: 目标厂商 API 基础地址\n- `x-api-key`: 目标厂商的 API Key\n\n### 在 Claude Code 中使用\n\n```bash\n# 编辑 ~/.claude/settings.json\n{\n  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"https://claude-worker-proxy.xxxx.workers.dev/gemini/https://xxx.com/v1beta\", # https://xxx.com/v1beta： 注意带版本号；需要支持函数调用！\n    \"ANTHROPIC_API_KEY\": \"sk-xxxx\",\n    \"ANTHROPIC_MODEL\": \"gemini-2.5-pro\", # 大模型，按需修改\n    \"ANTHROPIC_SMALL_FAST_MODEL\": \"gemini-2.5-flash\", # 小模型。也许你并不需要 ccr 那么强大的 route\n    \"API_TIMEOUT_MS\": \"600000\"\n  }\n}\n\nclaude\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglidea%2Fclaude-worker-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglidea%2Fclaude-worker-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglidea%2Fclaude-worker-proxy/lists"}