Skip to content
41 linesCodeBlameRaw
1{
2 "$schema": "../../node_modules/wrangler/config-schema.json",
3 "name": "g1t-models",
4 "account_id": "1e6f2cffa3f445920836e8ebe446bb58",
5 "compatibility_date": "2026-09-26",
6 "main": "./src/index.ts",
7 "workers_dev": false,
8 // Sandboxes reach models only through here, with a token for their run;
9 // a workspace's own code reaches the AI Gateway here with one of its
10 // access tokens, at /anthropic or /openai/v1.
11 "routes": [{ "pattern": "models.g1t.sh", "custom_domain": true }],
12 "services": [
13 { "binding": "INTEGRATIONS", "service": "g1t-integrations" },
14 // Where each run's tokens are counted, for usage views.
15 { "binding": "BILLING", "service": "g1t-billing" },
16 // Who an AI Gateway request's access token belongs to, and its scopes.
17 { "binding": "IDENTITY", "service": "g1t-identity" }
18 ],
19 // Each run's model spend, one object per model session, so its cost cap
20 // holds across every isolate its requests reach (src/run-spend.ts).
21 "durable_objects": {
22 "bindings": [{ "name": "RUN_SPEND", "class_name": "RunSpend" }]
23 },
24 "migrations": [{ "tag": "v1", "new_sqlite_classes": ["RunSpend"] }],
25 "vars": {
26 // g1t's own route, for runs g1t pays for: a Cloudflare AI Gateway,
27 // which holds g1t's key.
28 "AI_GATEWAY_ID": "g1t",
29 "CLOUDFLARE_ACCOUNT_ID": "1e6f2cffa3f445920836e8ebe446bb58"
30 },
31 // Once a day, after billing's daily run: every provider's model list,
32 // recorded with billing's catalogue (src/discover.ts). sudo's "Check
33 // for new models" does the same through the `Discovery` entrypoint.
34 "triggers": { "crons": ["29 5 * * *"] },
35 // Secrets: AI_GATEWAY_TOKEN; ANTHROPIC_API_KEY only if the gateway does
36 // not hold g1t's key; WORKERS_AI_TOKEN, a Cloudflare API token with
37 // Workers AI Read on this account, for the AI Gateway's open models
38 // (without it AI_GATEWAY_TOKEN is tried, and needs that permission too).
39 // Logs of a tenth of requests: every model call is one.
40 "observability": { "enabled": true, "head_sampling_rate": 0.1 }
41}