feat: add app ChatGPT-Adapter

This commit is contained in:
arch3rPro
2025-08-06 11:18:38 +08:00
parent fd5e0ac49d
commit bc52988dcc
9 changed files with 934 additions and 0 deletions

View File

@@ -188,6 +188,15 @@
</td>
<td width="33%" align="center">
<a href="./apps/chatgpt-adapter/README.md">
<img src="./apps/chatgpt-adapter/logo.png" width="60" height="60" alt="ChatGPT Adapter">
<br><b>ChatGPT Adapter</b>
</a>
🚀 多款AI聊天逆向接口适配到OpenAI标准接口
<kbd>latest</kbd> • [官网链接](https://github.com/bincooo/chatgpt-adapter)
</td>
</tr>
</table>

View File

@@ -0,0 +1,301 @@
<h1 align="center">ChatGPT Adapter</h1>
<div align="center">
<strong>多款AI聊天接口适配到OpenAI标准接口</strong>
</div>
<br>
## 📝 简介
ChatGPT Adapter是一个开源项目将多款AI聊天逆向接口适配到OpenAI API标准接口服务端。该服务集成了Coze、Bing Copilot、Cursor、Windsurf、Deepseek、You.com、Grok等多款AI的聊天接口使其符合OpenAI API标准方便开发者统一调用。
## ✨ 核心特性
- 🚀 **高速流式输出** - 支持实时流式响应,提供流畅的对话体验
- 💬 **多轮对话支持** - 完整的上下文记忆和多轮对话能力
- 🔌 **OpenAI API兼容** - 完全兼容OpenAI API格式无缝替换
- 🎯 **多模型接入** - 支持10+种主流AI服务接入
- 🛡️ **安全认证** - 支持API密钥认证和IP白名单
-**高性能缓存** - 内置缓存机制,提升响应速度
- 📊 **详细日志** - 完整的请求日志和错误追踪
## 🚀 支持的AI服务
| 服务名称 | 支持模型 | 状态 | 说明 |
|---------|---------|------|------|
| **Coze国际版** | Claude-3.5-Sonnet, GPT-4o等 | ✅ 稳定 | 支持WebSDK和Bot ID两种方式 |
| **Bing Copilot** | GPT-4 Turbo | 🔧 开发中 | 需要有效的Bing Cookie |
| **Cursor Editor** | Claude-3.5-Sonnet, GPT-4o等 | ✅ 稳定 | 支持多种编程模型 |
| **Windsurf Editor** | Claude-3.5-Sonnet, GPT-4o等 | ✅ 稳定 | Codeium提供的AI编程助手 |
| **Deepseek** | Deepseek-Chat, Deepseek-Reasoner | ✅ 稳定 | 国产优秀AI模型 |
| **You.com** | GPT-4, Claude-3.5等 | ✅ 稳定 | 支持多种主流模型 |
| **Grok** | Grok-2, Grok-3 | ✅ 稳定 | X平台的AI助手 |
| **LMSYS Arena** | 多种开源模型 | ✅ 稳定 | 学术研究平台 |
| **Qodo AI** | 编程专用模型 | ✅ 稳定 | 原Codium专注代码生成 |
| **Huggingface** | Stable Diffusion等 | ✅ 稳定 | 主要用于图像生成 |
## 🔧 1Panel安装使用
### 1. 应用安装
1. 在1Panel应用商店中搜索"ChatGPT Adapter"
2. 点击安装等待Docker镜像拉取完成
3. 配置应用参数(端口、存储路径等)
4. 启动应用
### 2. 配置文件设置
安装完成后需要创建配置文件。在1Panel文件管理中进入应用目录
```
/opt/1panel/apps/chatgpt-adapter/chatgpt-adapter/latest/
```
创建或编辑`config.yaml`文件:
```yaml
# 基础服务配置
port: 8080
host: "0.0.0.0"
debug: false
timeout: 300
cors: true
# Coze配置示例推荐
coze:
websdk:
model: claude-35-sonnet-200k
system: "你是一个有用的AI助手"
bot: custom-assistant
accounts:
- email: "your_email@gmail.com"
password: "your_password"
validate: "your_email@gmail.com"
# Deepseek配置示例
deepseek:
cookie: 'your_deepseek_cookie_here'
# 更多配置请参考config.yaml.example文件
```
### 3. 获取认证信息
#### Coze配置
- 访问 [coze.com](https://www.coze.com) 注册账号
- 使用Gmail邮箱注册仅支持邮箱验证登录
- 将邮箱和密码填入配置文件
#### Deepseek配置详细步骤
**重要提示Deepseek需要有效的cookie才能正常工作请按以下步骤获取**
1. **访问Deepseek官网**
- 打开浏览器访问 [https://chat.deepseek.com/](https://chat.deepseek.com/)
- 使用邮箱或手机号注册/登录账号
2. **获取Cookie关键步骤**
- 登录成功后按F12打开浏览器开发者工具
- 切换到"Network"(网络)标签页
- 在聊天界面发送一条测试消息(如"你好"
- 在网络请求列表中找到任意一个请求通常是chat相关的请求
- 点击该请求,在右侧面板找到"Request Headers"(请求头)
- 找到"Cookie"字段复制完整的cookie值
3. **配置文件设置**
```yaml
deepseek:
cookie: "这里粘贴从浏览器复制的完整cookie字符串"
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15'
```
4. **注意事项**
- Cookie通常很长包含多个键值对请确保复制完整
- Cookie有时效性失效后需要重新获取
- 如果仍然出现认证失败,请确认账号状态正常且有使用权限
**示例Cookie格式**
```
intercom-device-id-gxxx=...; _ga=...; _gid=...; session_token=...; user_token=...
```
#### 其他服务配置
详细的Cookie获取方法请参考[官方配置文档](https://bincooo.github.io/chatgpt-adapter)
### 4. 重启应用
配置完成后在1Panel中重启ChatGPT Adapter应用使配置生效。
## 🌐 API使用方法
### 基础调用
```bash
curl -X POST http://your-server:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key" \
-d '{
"model": "coze/websdk",
"messages": [
{
"role": "user",
"content": "你好,请介绍一下自己"
}
],
"stream": true
}'
```
### 支持的模型列表
```bash
# 获取可用模型列表
curl http://your-server:8080/v1/models
```
### 常用模型标识符
- `coze/websdk` - Coze WebSDK模式
- `deepseek-chat` - Deepseek聊天模型
- `cursor/claude-3-5-sonnet-20241022` - Cursor Claude模型
- `windsurf/claude-3-5-sonnet` - Windsurf Claude模型
- `you/gpt_4o` - You.com GPT-4o模型
- `grok-2` - Grok第二代模型
## 🔒 安全配置
### API密钥认证
```yaml
auth:
keys:
- "sk-your-custom-api-key-here"
- "sk-another-api-key-here"
```
### IP白名单
```yaml
auth:
whitelist:
- "127.0.0.1"
- "192.168.1.0/24"
- "your-server-ip"
```
### 限流配置
```yaml
rate_limit:
requests_per_minute: 60
requests_per_hour: 1000
```
## 📊 监控与日志
### 日志配置
```yaml
log:
level: "info"
file: "./logs/adapter.log"
max_size: 100
max_backups: 5
max_age: 30
```
### 健康检查
```bash
# 检查服务状态
curl http://your-server:8080/health
# 查看服务信息
curl http://your-server:8080/v1/models
```
## 🛠️ 故障排除
### 常见问题
1. **服务无法启动**
- 检查端口是否被占用
- 确认配置文件格式正确
- 查看Docker容器日志
2. **模型调用失败**
- 验证Cookie是否有效
- 检查网络连接
- 确认模型标识符正确
3. **认证失败**
- 检查API密钥配置
- 验证IP是否在白名单中
- 确认请求头格式正确
### 日志查看
在1Panel中查看应用日志
```bash
# 查看实时日志
docker logs -f chatgpt-adapter
# 查看错误日志
docker logs chatgpt-adapter 2>&1 | grep ERROR
```
## 📚 进阶配置
### 代理设置
```yaml
# HTTP代理
proxy: "http://127.0.0.1:7890"
# SOCKS5代理
proxy: "socks5://127.0.0.1:1080"
```
### 缓存配置
```yaml
cache:
type: "memory"
ttl: 3600
# Redis缓存
# redis:
# addr: "localhost:6379"
# password: ""
# db: 0
```
### 自定义模型
```yaml
# 添加自定义模型映射
models:
custom-gpt4:
type: "coze"
model: "coze/your-bot-id-xxxxx-1000-w"
```
## 🔗 相关链接
- **项目主页**: [GitHub仓库](https://github.com/bincooo/chatgpt-adapter)
- **官方文档**: [配置文档](https://bincooo.github.io/chatgpt-adapter)
- **问题反馈**: [Issues页面](https://github.com/bincooo/chatgpt-adapter/issues)
- **更新日志**: [Release页面](https://github.com/bincooo/chatgpt-adapter/releases)
## 📄 许可证
本项目基于MIT许可证开源详情请查看[LICENSE](https://github.com/bincooo/chatgpt-adapter/blob/main/LICENSE)文件。
## 🤝 贡献
欢迎提交Issue和Pull Request来帮助改进项目
---
<div align="center">
<strong>如果这个项目对您有帮助,请给个⭐️支持一下!</strong>
</div>

View File

@@ -0,0 +1,278 @@
<h1 align="center">ChatGPT Adapter</h1>
<div align="center">
<img src="logo.png" alt="ChatGPT Adapter Logo" width="120" height="120">
</div>
<div align="center">
<strong>Multiple AI Chat Interfaces Adapted to OpenAI Standard API</strong>
</div>
<br>
## 📝 Introduction
ChatGPT Adapter is an open-source project that adapts multiple AI chat reverse interfaces to the OpenAI API standard interface server. This service integrates chat interfaces from Coze, Bing Copilot, Cursor, Windsurf, Deepseek, You.com, Grok, and more, making them conform to the OpenAI API standard for easy and unified developer access.
## ✨ Core Features
- 🚀 **High-speed Streaming Output** - Real-time streaming responses for smooth conversation experience
- 💬 **Multi-turn Conversation Support** - Complete context memory and multi-turn dialogue capabilities
- 🔌 **OpenAI API Compatible** - Fully compatible with OpenAI API format, seamless replacement
- 🎯 **Multiple Model Integration** - Support for 10+ mainstream AI services
- 🛡️ **Security Authentication** - API key authentication and IP whitelist support
-**High-performance Caching** - Built-in caching mechanism for improved response speed
- 📊 **Detailed Logging** - Complete request logs and error tracking
## 🚀 Supported AI Services
| Service | Supported Models | Status | Notes |
|---------|------------------|--------|-------|
| **Coze International** | Claude-3.5-Sonnet, GPT-4o, etc. | ✅ Stable | Supports WebSDK and Bot ID methods |
| **Bing Copilot** | GPT-4 Turbo | 🔧 In Development | Requires valid Bing Cookie |
| **Cursor Editor** | Claude-3.5-Sonnet, GPT-4o, etc. | ✅ Stable | Supports multiple programming models |
| **Windsurf Editor** | Claude-3.5-Sonnet, GPT-4o, etc. | ✅ Stable | AI programming assistant by Codeium |
| **Deepseek** | Deepseek-Chat, Deepseek-Reasoner | ✅ Stable | Excellent domestic AI model |
| **You.com** | GPT-4, Claude-3.5, etc. | ✅ Stable | Supports multiple mainstream models |
| **Grok** | Grok-2, Grok-3 | ✅ Stable | AI assistant from X platform |
| **LMSYS Arena** | Various open-source models | ✅ Stable | Academic research platform |
| **Qodo AI** | Programming-specific models | ✅ Stable | Formerly Codium, focused on code generation |
| **Huggingface** | Stable Diffusion, etc. | ✅ Stable | Mainly for image generation |
## 🔧 1Panel Installation Guide
### 1. Application Installation
1. Search for "ChatGPT Adapter" in the 1Panel App Store
2. Click install and wait for Docker image download
3. Configure application parameters (port, storage path, etc.)
4. Start the application
### 2. Configuration File Setup
After installation, create a configuration file. Navigate to the application directory in 1Panel file manager:
```
/opt/1panel/apps/chatgpt-adapter/chatgpt-adapter/latest/
```
Create or edit the `config.yaml` file:
```yaml
# Basic service configuration
port: 8080
host: "0.0.0.0"
debug: false
timeout: 300
cors: true
# Coze configuration example (recommended)
coze:
websdk:
model: claude-35-sonnet-200k
system: "You are a helpful AI assistant"
bot: custom-assistant
accounts:
- email: "your_email@gmail.com"
password: "your_password"
validate: "your_email@gmail.com"
# Deepseek configuration example
deepseek:
cookie: 'your_deepseek_cookie_here'
# For more configurations, refer to config.yaml.example file
```
### 3. Authentication Information
#### Coze Configuration
- Visit [coze.com](https://www.coze.com) to register an account
- Register with Gmail (only email verification login supported)
- Fill in email and password in the configuration file
#### Deepseek Configuration
- Visit [deepseek.com](https://www.deepseek.com) and log in
- Press F12 to open developer tools, check network requests
- Copy Cookie value to configuration file
#### Other Service Configurations
For detailed Cookie acquisition methods, refer to: [Official Configuration Documentation](https://bincooo.github.io/chatgpt-adapter)
### 4. Restart Application
After configuration, restart the ChatGPT Adapter application in 1Panel to apply the settings.
## 🌐 API Usage
### Basic Call
```bash
curl -X POST http://your-server:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key" \
-d '{
"model": "coze/websdk",
"messages": [
{
"role": "user",
"content": "Hello, please introduce yourself"
}
],
"stream": true
}'
```
### Supported Model List
```bash
# Get available model list
curl http://your-server:8080/v1/models
```
### Common Model Identifiers
- `coze/websdk` - Coze WebSDK mode
- `deepseek-chat` - Deepseek chat model
- `cursor/claude-3-5-sonnet-20241022` - Cursor Claude model
- `windsurf/claude-3-5-sonnet` - Windsurf Claude model
- `you/gpt_4o` - You.com GPT-4o model
- `grok-2` - Grok second generation model
## 🔒 Security Configuration
### API Key Authentication
```yaml
auth:
keys:
- "sk-your-custom-api-key-here"
- "sk-another-api-key-here"
```
### IP Whitelist
```yaml
auth:
whitelist:
- "127.0.0.1"
- "192.168.1.0/24"
- "your-server-ip"
```
### Rate Limiting
```yaml
rate_limit:
requests_per_minute: 60
requests_per_hour: 1000
```
## 📊 Monitoring and Logging
### Log Configuration
```yaml
log:
level: "info"
file: "./logs/adapter.log"
max_size: 100
max_backups: 5
max_age: 30
```
### Health Check
```bash
# Check service status
curl http://your-server:8080/health
# View service information
curl http://your-server:8080/v1/models
```
## 🛠️ Troubleshooting
### Common Issues
1. **Service Won't Start**
- Check if port is occupied
- Verify configuration file format
- Check Docker container logs
2. **Model Call Failure**
- Verify Cookie validity
- Check network connection
- Confirm model identifier is correct
3. **Authentication Failure**
- Check API key configuration
- Verify IP is in whitelist
- Confirm request header format
### Log Viewing
View application logs in 1Panel:
```bash
# View real-time logs
docker logs -f chatgpt-adapter
# View error logs
docker logs chatgpt-adapter 2>&1 | grep ERROR
```
## 📚 Advanced Configuration
### Proxy Settings
```yaml
# HTTP proxy
proxy: "http://127.0.0.1:7890"
# SOCKS5 proxy
proxy: "socks5://127.0.0.1:1080"
```
### Cache Configuration
```yaml
cache:
type: "memory"
ttl: 3600
# Redis cache
# redis:
# addr: "localhost:6379"
# password: ""
# db: 0
```
### Custom Models
```yaml
# Add custom model mapping
models:
custom-gpt4:
type: "coze"
model: "coze/your-bot-id-xxxxx-1000-w"
```
## 🔗 Related Links
- **Project Homepage**: [GitHub Repository](https://github.com/bincooo/chatgpt-adapter)
- **Official Documentation**: [Configuration Documentation](https://bincooo.github.io/chatgpt-adapter)
- **Issue Reporting**: [Issues Page](https://github.com/bincooo/chatgpt-adapter/issues)
- **Changelog**: [Release Page](https://github.com/bincooo/chatgpt-adapter/releases)
## 📄 License
This project is open-sourced under the MIT License. For details, see the [LICENSE](https://github.com/bincooo/chatgpt-adapter/blob/main/LICENSE) file.
## 🤝 Contributing
Issues and Pull Requests are welcome to help improve the project!
---
<div align="center">
<strong>If this project helps you, please give it a ⭐️ for support!</strong>
</div>

View File

@@ -0,0 +1,27 @@
name: ChatGPT Adapter
tags:
- AI / 大模型
title: 多款AI聊天接口适配到OpenAI标准接口
description: ChatGPT Adapter是一个开源项目将多款AI聊天逆向接口如coze、deepseek、cursor、bing等适配到OpenAI API标准接口服务端支持高速流式输出和多轮对话。
additionalProperties:
key: chatgpt-adapter
name: ChatGPT Adapter
tags:
- AI
shortDescZh: 多款AI聊天接口适配到OpenAI标准接口
shortDescEn: Multiple AI chat interfaces adapted to OpenAI standard API
type: website
crossVersionUpdate: true
limit: 0
recommend: 0
website: https://bincooo.github.io/chatgpt-adapter
github: https://github.com/bincooo/chatgpt-adapter
document: https://bincooo.github.io/chatgpt-adapter
description:
en: Multiple AI chat interfaces adapted to OpenAI standard API
zh: 多款AI聊天接口适配到OpenAI标准接口
zh-Hant: 多款AI聊天接口適配到OpenAI標準接口
memoryRequired: 512
architectures:
- amd64
- arm64

View File

@@ -0,0 +1,44 @@
# ChatGPT Adapter 配置示例文件
# 详细配置请参考官方文档: https://bincooo.github.io/chatgpt-adapter
# 基础服务配置
port: 8080 # 服务端口
host: "0.0.0.0" # 监听地址0.0.0.0表示监听所有网卡
debug: true # 调试模式,开启后会输出详细日志
timeout: 300 # 请求超时时间(秒)
cors: true # 是否启用跨域支持
# Deepseek配置 - 需要有效的cookie才能使用
deepseek:
# 必需配置从浏览器获取的cookie
# 1. 访问 https://chat.deepseek.com/
# 2. 登录账号
# 3. 打开浏览器开发者工具 -> Network -> 找到任意请求 -> 复制Cookie头
# 4. 将完整的cookie字符串粘贴到下面
cookie: "HWWAFSESID=d774326ec18baba0ccf; HWWAFSESTIME=1754295290913; smidV2=20250804161452e8b3a8907977f8a0ec8462a0dc7be56d001f9ed69e49c4330; .thumbcache_6b2e5483f9d858d7c661c5e276b6a6ae=CAlgC1owPX3Xs41W3lqjGBrZu/3f0DNIJQwLD1xLbxwVTWpsGn7p9L2F7nvFcmDh6LXHg6Knwz5NpMdUoGlyYQ%3D%3D; ds_session_id=e237ecf78b7f4b5aa81d54273d468884; intercom-session-guh50jw4=allXUWFkOGpXcWlOcm5FRkJrWGdEMlJTSnJHWmowc0IzWVpORzRmTDJuM1F4TldtVTZ2NTZTYmhqZVlndlo3NitSZnlzRDZvdmRHYzJMQTl2dk8yZ25DTzkvTUVOMmFEeUo1VmtXVXpYZ1k9LS1VeFM1SmVhS3hOSE5nRU1JRnpaTmNnPT0=--94be45cb00f6e0451b5e2245a085017620f959d5; intercom-device-id-guh50jw4=76d45f54-9682-40fb-857e-273b396c3c0c"
# 可选配置User-Agent通常不需要修改
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15'
# coze:
# websdk:
# model: claude-35-sonnet-200k
# system: "你是一个有用的AI助手"
# bot: custom-assistant
# accounts:
# - email: "wh1tecat2389@gmail.com"
# password: "wnbi ebkn jcyj oguk"
# validate: "wh1tecat2389@gmail.com"
# Browser-less服务配置 (Coze websdk必需)
# browser-less:
# enabled: true # 启用browser-less服务
# reversal: "http://your-browser-less-service:8080" # 如果使用外部browser-less服务
# ==================== 认证配置 ====================
# API密钥认证 - 为API访问添加安全验证
# auth:
# keys:
# - "ks-chatgpt-adapter-your-custom-key-here" # 自定义API密钥1
# - "ks-another-custom-api-key-for-backup" # 自定义API密钥2备用
# - "ks-team-shared-key-for-multiple-users" # 团队共享密钥

View File

@@ -0,0 +1,224 @@
# ChatGPT Adapter 配置示例文件
# 详细配置请参考官方文档: https://bincooo.github.io/chatgpt-adapter
# 基础服务配置
port: 8080 # 服务端口
host: "0.0.0.0" # 监听地址0.0.0.0表示监听所有网卡
debug: false # 调试模式,开启后会输出详细日志
timeout: 300 # 请求超时时间(秒)
cors: true # 是否启用跨域支持
# 代理配置(可选) - 某些服务可能需要代理访问
# proxy: "http://127.0.0.1:7890"
# proxy: "socks5://127.0.0.1:1080"
# ==================== 模型配置 ====================
# Coze 国际版配置
coze:
websdk:
model: claude-35-sonnet-200k # 可选: claude-35-sonnet-200k, claude-35-haiku-200k, gpt4o-8k, gpt4o-32k, gpt4o-128k, gpt4-125k, gpt35-16k
system: "你是一个有用的AI助手"
bot: custom-128k # 默认bot名称可自定义
accounts:
- email: "your_email@gmail.com"
password: "your_password"
validate: "your_email@gmail.com"
# Browser-less服务配置 (Coze websdk必需)
browser-less:
enabled: true # 启用browser-less服务
# reversal: "http://your-browser-less-service:8080" # 如果使用外部browser-less服务
# 注意:
# 1. Coze websdk需要browser-less服务来获取cookies必须配置browser-less.enabled=true或提供reversal URL
# 2. accounts为gmail登录邮箱仅限通过输入邮箱验证登录的账户可用未实现人机验证
# 3. 对网络要求较高,建议使用稳定的网络环境
# 4. 也可以自行在coze.com部署websdk后获取bot_id然后拼接成 coze/{bot_id}-xxxxx-1000-w 字符串作为model参数
# Bing Copilot配置 (开发中...)
bing:
proxied: true # 是否开启代理
cookies:
- scopeId: "your_scope_id" # 从控制台脚本获取
idToken: "your_id_token" # 从控制台脚本获取
cookie: "your_bing_cookie" # 从F12网络面板获取
# 获取方法请参考官方文档中的控制台脚本
# Cursor Editor配置
cursor:
checksum: 'zo-v9_v2qxRYcau35NDnAHAVxQkLe6IHw8opkpKV4oLyo0PhPeSpj4QTw2VJ20Lngrz7XNTQ/clDRF5FOm3B1uK-mQDyFBRqD8JNj4kLByaAfm4AqK6IMbFYcrqXMMXexubsTRrr1'
# 注意: checksum为设备id随机。若不配置将自动生成一个
# authorization为网页登录后的cookie WorkosCursorSessionToken
# ==================== Deepseek配置 ====================
# Deepseek是一个强大的AI模型支持中文对话
deepseek:
# 必需从浏览器获取的cookie
# 获取方法:
# 1. 访问 https://chat.deepseek.com/ 并登录
# 2. 打开浏览器开发者工具(F12) -> Network标签
# 3. 发送一条消息找到请求头中的Cookie
# 4. 复制完整的cookie字符串
cookie: 'intercom-device-id-gxxx .......... xxx'
# 可选自定义User-Agent海外地区可能需要
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15'
# 注意事项:
# 1. 中国地区通常不需要配置cookie但如果出现认证失败仍需要配置
# 2. 海外地区出现403错误时必须配置cookie和userAgent
# 3. Cookie有效期有限失效后需要重新获取
# 4. 确保浏览器获取cookie时的IP与服务器IP一致如果使用代理
# 5. authorization可通过控制台脚本获取:
# var token = localStorage.getItem('userToken'); console.log(JSON.parse(token).value);
# Windsurf Editor配置
windsurf:
proxied: false # 是否使用代理
# authorization为网页登录后访问 https://codeium.com/profile?referrer=extension
# F12查看网络面板的 GetAnalytics 请求头x-api-key
# You.com配置
you:
custom: true # 启动自定义模型,不存在会自动创建
task: false # 定时器过cf验证
model:
- 'custom_model_name' # 自定义模型名称
cookies:
- 'your_you_cookie_here' # 完整的cookie字符串
# Grok配置
grok:
think_reason: false # 是否开启思考模式
disable_search: false # 是否关闭联网搜索
cookies:
- 'your_grok_cookie' # F12打开网络面板抓取cookie
# authorization = cookie
# ==================== 支持的模型列表 ====================
# Coze模型:
# - coze/websdk
# - coze/{bot_id}-xxxx-1000-w
# Bing模型:
# - bing
# Cursor模型:
# - cursor/claude-3-5-sonnet-20241022
# - claude-3.7-sonnet
# - claude-3.7-sonnet-thinking
# - cursor/claude-3-opus
# - cursor/claude-3.5-haiku
# - cursor/claude-3.5-sonnet
# - cursor/cursor-small
# - cursor/gpt-3.5-turbo
# - cursor/gpt-4
# - cursor/gpt-4-turbo-2024-04-09
# - cursor/gpt-4o
# - cursor/gpt-4o-mini
# - cursor/o1-mini
# - cursor/o1-prevew
# Deepseek模型:
# - deepseek-chat
# - deepseek-reasoner
# Windsurf模型:
# - windsurf/claude-3-5-sonnet
# - claude-3-7-sonnet
# - claude-3-7-sonnet-think
# - windsurf/gpt4o
# - windsurf/deepseek-chat
# - windsurf/deepseek-reasoner
# - windsurf/gpt4-o3-mini
# - windsurf/gemini-2.0-flash
# You.com模型:
# - you/gpt_4
# - you/gpt_4o
# - you/gpt_4o_mini
# - you/gpt_4_turbo
# - you/openai_o1
# - you/openai_o1_mini
# - you/claude_2
# - you/claude_3_haiku
# - you/claude_3_sonnet
# - you/claude_3_5_sonnet
# - you/claude_3_opus
# - you/gemini_pro
# - you/gemini_1_5_pro
# - you/gemini_1_5_flash
# Grok模型:
# - grok-2
# - grok-3
# ==================== 可选配置 ====================
# ==================== 认证配置 ====================
# API密钥认证 - 为API访问添加安全验证
auth:
keys:
- "sk-chatgpt-adapter-your-custom-key-here" # 自定义API密钥1
- "sk-another-custom-api-key-for-backup" # 自定义API密钥2备用
- "sk-team-shared-key-for-multiple-users" # 团队共享密钥
whitelist: # IP白名单(可选) - 只允许特定IP访问
- "127.0.0.1" # 本地访问
- "192.168.1.0/24" # 局域网访问
- "your-server-public-ip" # 您的服务器公网IP
# 注意事项:
# 1. API密钥格式建议以"sk-"开头,但不是强制要求
# 2. 可以配置多个密钥,支持密钥轮换和备份
# 3. 如果配置了auth.keys则所有API请求都必须携带有效的Authorization头
# 4. IP白名单是可选的如果配置了则只允许白名单内的IP访问
# 5. 密钥长度建议至少32位确保安全性
# 日志配置(可选)
# log:
# level: "info" # 日志级别: debug/info/warn/error
# file: "./logs/adapter.log" # 日志文件路径
# max_size: 100 # 单个日志文件最大大小(MB)
# max_backups: 5 # 保留的日志文件数量
# max_age: 30 # 日志文件保留天数
# 限流配置(可选) - 防止API滥用
# rate_limit:
# requests_per_minute: 60 # 每分钟最大请求数
# requests_per_hour: 1000 # 每小时最大请求数
# 缓存配置(可选) - 提高响应速度
# cache:
# type: "memory" # 缓存类型: memory/redis
# ttl: 3600 # 缓存过期时间(秒)
# # Redis配置(当type为redis时)
# # redis:
# # addr: "localhost:6379"
# # password: ""
# # db: 0
# ==================== 使用说明 ====================
# 1. 根据需要启用相应的模型配置
# 2. Cookie和Token获取方法请参考官方文档: https://bincooo.github.io/chatgpt-adapter
# 3. 某些服务可能需要代理才能正常访问
# 4. 建议在生产环境中启用认证和限流配置
# 5. 调试模式会输出详细日志,生产环境建议关闭
# 6. 各模型的具体使用方法和参数请参考官方文档对应章节
# ==================== API调用示例 ====================
# curl -i -X POST \
# -H "Content-Type: application/json" \
# -H "Authorization: Bearer your_token_here" \
# -d '{
# "stream": true,
# "model": "coze/websdk",
# "messages": [
# {
# "role": "user",
# "content": "你好"
# }
# ]
# }' \
# 'http://127.0.0.1:8080/v1/chat/completions'

View File

@@ -0,0 +1,24 @@
additionalProperties:
formFields:
- default: 8080
envKey: PANEL_APP_PORT_HTTP
labelEn: API Port
labelZh: API接口端口
label:
en: API Port
zh: API接口端口
zh-Hant: API接口埠
required: true
rule: paramPort
type: number
- default: 3000
envKey: PANEL_APP_PORT_BROWSER
labelEn: Browser-less Port
labelZh: Browser-less端口
label:
en: Browser-less Port
zh: Browser-less端口
zh-Hant: Browser-less埠
required: true
rule: paramPort
type: number

View File

@@ -0,0 +1,27 @@
services:
chatgpt-adapter:
image: 'ghcr.io/bincooo/chatgpt-adapter:latest'
container_name: ${CONTAINER_NAME}
restart: always
networks:
- 1panel-network
volumes:
- './config.yaml:/app/config.yaml'
ports:
- ${PANEL_APP_PORT_HTTP}:8080
labels:
createdBy: "Apps"
browser-less:
image: browserless/chrome:latest
container_name: ${CONTAINER_NAME}-browser
restart: unless-stopped
environment:
- CONCURRENT=10
- TOKEN=your-browser-token
ports:
- ${PANEL_APP_PORT_BROWSER}:3000
networks:
- 1panel-network
networks:
1panel-network:
external: true

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB