Repository navigation
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
124 lines (112 loc) · 5.68 KB
/
Copy pathconfig.example.yaml
File metadata and controls
124 lines (112 loc) · 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# ============================================================
# web2api 配置文件 —— 多引擎号池管理网关
# 复制为 config.yaml 后按需修改;号池账号建议直接在管理台添加
# ============================================================
server:
listen: "0.0.0.0:8800" # 网关监听地址(客户端 Base URL 填 http://<本机IP>:8800/v1)
api_keys: # 种子 Key:启动时自动导入 Key 库(之后可在管理台增删)
- "sk-web2api"
# 首次打开 /admin 设置邮箱、密码、昵称和 Redis 连接
db_path: "data/web2api.db" # SQLite:号池账号 / API Key / 用量
log_level: "info"
routing:
default_engine: "auto" # auto | a | b | codex | antigravity | kiro | workbuddy | custom
engine_a_models: [] # 显式强制走引擎A 的模型(支持前缀与 * 通配)
engine_b_models: [] # 显式强制走引擎B 的模型
engine_models: # 订阅/第三方引擎的强制路由模型
codex: [] # 例:["gpt-*"]
antigravity: [] # 例:["claude-sonnet-*", "gemini-3-*"]
kiro: [] # 例:["claude-sonnet-4"]
workbuddy: [] # 例:["auto-chat"]
custom: [] # 例:["gpt-4o", "claude-*"]
# ------------------------------------------------------------
# 引擎A:gemini.google.com 网页版(Go 原生逆向,Cookie 会话)
# 这里的 accounts 是首次启动的种子,会自动迁移进数据库;
# 日常加号/换Cookie统一使用引擎B协议的 storage-state(管理台会自动转换)
# ------------------------------------------------------------
engine_a:
enabled: true
proxy: "" # 访问 Google 需要的代理,如 http://127.0.0.1:7890
refresh_seconds: 600
timeout_seconds: 300
accounts: [] # 例:- name: "主号" psid: "" psidts: ""
# ------------------------------------------------------------
# 引擎B:AI Studio(两种模式)
#
# mode=native(推荐,默认):内置纯 Go 逆向(AI Studio 私有协议 + WAA go 后端),
# 零浏览器、零外部服务依赖。auth 目录放账号凭据(storage-state.json);
# 也可在管理台直接粘贴 storage-state.json 内容添加。
#
# mode=upstream:转发到任意 OpenAI 兼容服务。
# ------------------------------------------------------------
engine_b:
enabled: true
mode: "native"
# ---- native 模式 ----
auth_states: "auth" # 账号目录(管理台添加的号也存这里)
proxy: ""
routing_strategy: "round-robin" # 多号调度:round-robin | account-sticky
upstream_channels: "playground,build"
per_account_concurrency: 2
init_timeout_seconds: 120
request_timeout_seconds: 300
temporary_chat: false
refresh_seconds: 300
# ---- upstream 模式(mode=upstream 时生效)----
base_url: "http://127.0.0.1:2048"
api_key: ""
passthrough: true
# 官方 Gemini 后端:独立于网页账号池,完整支持官方参数和事件
gemini_api:
enabled: false
base_url: "https://generativelanguage.googleapis.com"
api_key: "" # 推荐通过 WEB2API_GEMINI_API_KEY 注入
access_token: "" # GCS files:register 等需要 OAuth 的功能
proxy: ""
timeout_seconds: 0 # 0 不限制总时长,允许长后台 SSE
# ------------------------------------------------------------
# 订阅引擎 + 第三方 Key:codex / antigravity / kiro / workbuddy / custom
# 每个引擎独立账号池,账号建议在管理台添加;
# 启用后即可在 /v1/chat/completions 使用对应模型(模型名见管理台)
#
# custom:管理台填 base_url + api_key(OpenAI 兼容)。
# 默认启用;也可在下方用种子账号,或完全在管理台动态加号。
#
# 模型路由:显式配置 > 订阅/custom 目录精确命中 > 多模态关键词走引擎B >
# auto 回退引擎B。落到引擎B且模型不在目录时,改用目录第一个可用模型。
# 也可用上面的 routing.engine_models 或 routing.default_engine 显式指定。
# ------------------------------------------------------------
engines:
# 以下引擎默认启用:管理台可直接加号,无需改配置重启。
# 空号池时不接单;访问上游通常仍需 proxy。
# OpenAI GPT / Codex(ChatGPT 订阅号,模型 gpt-5.x / gpt-6 系列)
codex:
enabled: true
proxy: "" # 访问 chatgpt.com 需代理,如 http://127.0.0.1:7890
accounts: [] # 种子:- name: "" refresh_token: "" email: ""
# Google Antigravity(Cloud AI Companion,Claude + Gemini 双模型通道)
antigravity:
enabled: true
proxy: "" # 访问 googleapis.com 需代理
accounts: [] # 种子:- name: "" refresh_token: "" project_id: ""
# AWS Kiro(CodeWhisperer,Claude 模型;refresh_token 从
# Kiro IDE 的 ~/.aws/sso/cache/kiro-auth-token.json 提取)
# 注意:Kiro 上游风控较严,建议少量账号自用
kiro:
enabled: true
proxy: ""
accounts: []
# 腾讯 CodeBuddy / WorkBuddy(SaaS 订阅;管理台扫码授权或粘贴 accessToken)
workbuddy:
enabled: true
base_url: "https://www.codebuddy.ai"
proxy: ""
accounts: []
# 第三方 OpenAI(Base URL + API Key)
custom:
enabled: true
proxy: ""
accounts: [] # 种子:- name: "OpenRouter"
# base_url: "https://openrouter.ai/api"
# api_key: "sk-..."
# models: ["openai/gpt-4o"]