anuma2api / config.toml
li2895's picture
anuma2api HF space: 网关(无注册机,账号面板上传)
1e84411
Raw
History Blame Contribute Delete
4.93 kB
# Anuma2api 配置。复制为 config.toml 并填值(config.toml 已 gitignore,本文件传 git)。
# 账号凭据不在此处,放 account/<name>.json(见 account/main.json.example 或运行注册机)。
# ===== 网关(主程序读)=====
[gateway]
host = "0.0.0.0"
port = 8088
api_key = "" # 客户端访问 /v1 的 key(Authorization: Bearer <key>);留空 = 无认证
# ===== 代理(主程序 + 注册机)=====
[proxy]
# 默认代理:网关访问上游时使用;留空 = 直连
# 例:http://127.0.0.1:7890 或 socks5://127.0.0.1:1080
url = ""
# 注册机代理:CLI / 自动补号 / captcha 浏览器;留空 = 回退到 url;两者都空 = 直连
registrar_url = ""
# ===== 日志(主程序)=====
[logging]
enabled = true # 是否写入日志文件;false = 仅控制台,不落盘
dir = "logs" # 日志目录(gitignore)
filename = "gateway.log" # 主日志文件名;轮转后为 gateway.log.1 …
level = "INFO" # DEBUG / INFO / WARNING / ERROR
max_bytes = 10485760 # 单文件最大字节(默认 10 MiB),超出后轮转
backup_count = 5 # 轮转保留份数(gateway.log.1 … .N)
log_request_body = true # 是否记录请求 body(Authorization 等已脱敏)
log_response_body = true # 是否记录响应 body(含流式聚合后的内容,已脱敏/截断)
max_body_chars = 4000 # body 日志最大字符数
# ===== 上游:目标网站行为(主程序 + 注册机共享)=====
[upstream]
# 通用行为参数(与具体网站无关)
request_timeout = 120.0 # 单次请求总超时(秒)
# 2026-08-08 用户定案:生图不设短窗口掐流(gpt-image-2 生图实测 108-161s,25s 掐会误杀
# 正常生图)。完整读完流,超时交给 request_timeout,fence 判定看流结束后有无 media URL。
image_success_cooldown = 300.0 # 生图成功后该账号主动冷却秒数(防同一号连击触发 fence;0=关闭)
poll_interval = 1.2 # 轮询式上游的轮询间隔(秒)
token_refresh_margin = 300 # 凭据到期前多少秒主动刷新
tool_call_retries = 3 # prompt 模式被拒绝时换变体重试次数(0 = 不重试;仅 refusal_detect=true 时生效)
tool_call_dup_limit = 2 # native 模式:同一工具连续调用 N 轮后注入"停止重复、立即干活"纠正(0 = 关闭)
tool_forge_limit = 8 # native 模式:某工具历史空刷 ≥N 次且从无真实推进 -> 本轮从 tools 列表物理剔除它(0 = 关闭)
tool_read_cap = 30 # native 模式:read 累计 ≥N 次且远超其它动作(贪读不收口) -> 注入"读够了立即给结论"软纠正(0 = 关闭)
# 可选对抗策略(默认关;copy_skeleton --with-soften-system / --with-refusal-detect 初始化时写 true)
soften_system = false # true:客户端 system 走柔和背景包装(不改实质指令)
refusal_detect = false # true:拒绝/识破检测 + tool 指令变体重试 + 解析跳过拒绝文
strategy = "native" # tool 策略:prompt(注入解析,默认)/ native(上游原生 function-calling 直通)
# 目标网站专属端点(按抓包结果填)
chat_url = "" # 上游「发送对话」端点
# 可恢复失效(额度耗尽 / 人机验证)的冷却配置
# "disable" 仅对 QUOTA_EXHAUSTED 生效:直接标记 disabled(适合月额度/永不过期额度)
quota_exhausted_action = "cooldown"
cooldown_seconds = 600.0 # 默认冷却时长(秒)
# cooldown_seconds_quota = 3600.0 # QUOTA_EXHAUSTED 覆盖值(可选)
# cooldown_seconds_cf = 300.0 # CF_CHALLENGE 覆盖值(可选)
# 注册机可透传 [upstream] 段自定义字段,在 registrar/pipeline.py 读取
# supabase_url = "https://<project>.supabase.co"
# supabase_anon_key = "<anon/public key from JS bundle>"
# ===== 账号目录(主程序 + 注册机读)=====
[registry]
account_dir = "account" # 账号凭据目录(account/<name>.json,已 gitignore)
pool_watch_interval = 30.0 # 账号池热加载扫描间隔(秒);新写入的账号自动进池,网关不用重启(0=关闭)
# ===== 管理后台(主程序读)=====
[admin]
auth_key = "anuma-admin-dev-key" # /admin/* 鉴权(Authorization: Bearer <key> 或 ?auth_key=<key>);留空 = 关闭 admin(404)
# ===== 注册机:临时邮箱(注册机读)=====
[email]
base_url = "https://mailboxtemp.com"
poll_timeout = 180 # 等待验证码邮件的最大秒数
# ===== 注册机:人机验证(注册机读)=====
[captcha]
method = "cdp" # cdp(连 debug chrome 指纹自动过)/ semi(有头手动点)/ api(打码)
headless = false
proxy_url = ""
cdp_endpoint = "http://localhost:9222"
api_provider = "capsolver"
api_key = ""