[UNTESTED] [goairix/llm-proxy] 2 endpoint(s)
ChatGPT
API Proxy/ChatGPT
2,219 characters
Status: [UNTESTED]
Endpoints found:
http://localhost:8080/openai/v1/chat/completions
http://localhost:8080/openai/v1/responses
http://localhost:8080/anthropic/v1/messages
Source: https://github.com/goairix/llm-proxy
# LLM Proxy
A lightweight reverse proxy for OpenAI and Anthropic APIs, with per-key rate limiting, OpenTelemetry observability, structured logging, and a built-in dashboard.
## 功能特性
- **透明转发** — 请求头(含 `Authorization`、`x-api-key`)原样传递,无需修改客户端
- **Responses API** — 支持 OpenAI Responses API 的普通响应、后台响应和 SSE 流式事件
- **SSE 流式响应** — 原生支持 streaming,延迟零增加
- **按 Key 限流** — Token Bucket 算法,每个 API Key 独立计数,支持白名单和自定义配额
- **可观测性** — 可选 OTLP/HTTP traces 与 metrics,上游 client span 自动关联,Zap 日志包含 `trace_id` / `span_id`
- **健康检查** — 提供轻量的存活与就绪端点,不依赖上游 API 或 Collector 状态
- **结构化日志** — zap 输出至 stdout + 按天轮转文件,记录延迟、状态码、流量和 Trace 关联字段
- **Web 控制台** — 内嵌静态页面,展示运行状态、请求统计、Token 用量和限流配置
- **单二进制部署** — 静态编译,无外部依赖
## 路由规则
| 请求路径 | 转发至 |
|----------|--------|
| `GET /` | Web 控制台 |
| `GET /healthz` | 存活检查,进程可响应时返回 200 |
| `GET /readyz` | 就绪检查,HTTP 服务已进入服务状态时返回 200 |
| `/openai/*` | `https://api.openai.com/*` |
| `/anthropic/*` | `https://api.anthropic.com/*` |
**示例:**
```bash
# OpenAI
curl http://localhost:8080/openai/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-4o", "messages": [{"role": "user", "content": "Hello"}]}'
# OpenAI Responses API
curl http://localhost:8080/openai/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-5", "input": "Hello"}'
# Anthropic
curl http://localhost:8080/anthropic/v1/messages \
-H "x-api-key: $ANTH