-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwrangler.toml.example
More file actions
60 lines (54 loc) · 1.58 KB
/
wrangler.toml.example
File metadata and controls
60 lines (54 loc) · 1.58 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
name = "any-api-gateway"
main = "src/workers.ts"
compatibility_date = "2025-12-24"
workers_dev = true
preview_urls = true
# Optional: Custom domain routing (uncomment and modify)
# [[routes]]
# pattern = "your-domain.com/v1/*"
# zone_name = "your-domain.com"
[vars]
# 推荐:使用单一 JSONC 配置(ANY_API_CONFIG)描述所有 provider/model。
# 模型 ID 必须使用 `provider.modelName`(不提供默认模型/默认 provider)。
# 在 wrangler.toml 里可以用 TOML 的多行字符串(推荐),可读性更好:
ANY_API_CONFIG = '''
{
"version": 1,
"providers": {
"openai-provider": {
"type": "openai-responses",
"baseURL": "https://your-relay-server.example/openai",
"apiKey": "REPLACE_ME",
"quirks": {
"noInstructions": false,
"noPreviousResponseId": false
},
"models": {
"model-a": {
"upstreamModel": "gpt-5.2",
"options": {
"reasoningEffort": "high",
"maxInstructionsChars": 12000
}
}
}
},
"gemini-provider": {
"type": "gemini",
"baseURL": "https://generativelanguage.googleapis.com",
"apiKey": "REPLACE_ME",
"models": {
"model-b": { "upstreamModel": "gemini-3-pro-preview" }
}
}
}
}
'''
# Debug logging (optional)
# ANY_API_DEBUG = "true" # set "false"/"0" to disable
# Secrets (do not commit to git, use wrangler secret put):
# wrangler secret put WORKER_AUTH_KEY
# Optional: multiple client auth keys (comma-separated):
# wrangler secret put WORKER_AUTH_KEYS
[observability]
enabled = true