feat: 实现 Claude API 透传代理服务

实现完整的 Claude API 代理服务,支持:
- 透传 /v1/* 路径到上游 API
- 流式 (SSE) 和非流式响应
- JSONL 格式请求日志
- /health 健康检查端点
- Docker 多阶段构建
- Gitea Actions CI/CD 工作流

安全加固:
- 容器以非 root 用户运行
- 添加 Docker HEALTHCHECK
- 实现优雅关闭处理 (SIGTERM/SIGINT)

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
D8D Developer
2026-03-20 06:47:46 +00:00
parent 569a79272a
commit fafef0e034
12 changed files with 2009 additions and 0 deletions

30
package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "claude-api-proxy",
"version": "1.0.0",
"description": "Claude API 透明代理服务",
"main": "dist/index.js",
"scripts": {
"build": "tsc && tsc-alias",
"start": "node dist/index.js",
"dev": "tsx watch src/index.ts"
},
"keywords": [
"claude",
"api",
"proxy"
],
"author": "",
"license": "MIT",
"dependencies": {
"axios": "^1.7.9",
"dotenv": "^16.4.7",
"express": "^4.21.2"
},
"devDependencies": {
"@types/express": "^5.0.0",
"@types/node": "^22.10.5",
"tsc-alias": "^1.8.10",
"tsx": "^4.19.2",
"typescript": "^5.7.3"
}
}