v0.2.2: Cloudflare AI Gateway Unified Billing
Changes
- Unified Billing: Migrate from direct OpenAI API key to Cloudflare AI Gateway Unified Billing
- Replace
OPENAI_API_KEYsecret withCF_AIG_TOKEN - Use
cf-aig-authorizationheader instead ofAuthorization - Single billing through Cloudflare credits
- Replace
Configuration
Required Worker secret:
pnpm wrangler secret put CF_AIG_TOKENPrerequisites:
- Load credits in Cloudflare Dashboard → AI → AI Gateway → Credits
- Create Cloudflare API token with AI Gateway permissions
- Ensure AI Gateway
append-gatewayexists
Files Changed
packages/api/src/lib/suggestions.ts- Auth header and config interfacepackages/api/src/routes/batch.ts- Bindings and validationdocs/adr/0006-openai-gpt-5-mini-via-ai-gateway.md- Updated to Unified Billingdocs/vertical-slice.md- Updated Step 3 config