# AI gateway **Repository Path**: ccolt/ai-gateway ## Basic Information - **Project Name**: AI gateway - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-09 - **Last Updated**: 2026-03-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AI Gateway AI Gateway 是一个统一的 AI API 网关,支持对接多种 AI 服务提供商。 ## 功能特性 - 统一的 AI API 入口 - 支持多种 AI 提供商(OpenAI、Claude 等) - API Key 认证 - 请求限流 - 日志记录 ## 快速开始 ```bash # 启动服务 go run main.go # 或指定配置 ADDR=:8080 API_KEYS=key1,key2 go run main.go ``` ## API ### 健康检查 ```bash GET /health ``` ### 聊天接口 ```bash POST /v1/chat Authorization: Bearer { "model": "gpt-3.5-turbo", "messages": [ {"role": "user", "content": "Hello!"} ] } ``` ### 补全接口 ```bash POST /v1/completions Authorization: Bearer { "model": "text-davinci-003", "prompt": "Hello, world!" } ``` ## 项目结构 ``` ai-gateway/ ├── cmd/server/ # 服务入口 ├── internal/ # 内部包 │ ├── config/ # 配置 │ ├── handler/ # 请求处理 │ ├── middleware/ # 中间件 │ └── model/ # 数据模型 └── pkg/ # 公共包 └── logger/ # 日志 ``` ## 贡献 欢迎提交 Pull Request!