Skip to content

v0.2.2: Cloudflare AI Gateway Unified Billing

Choose a tag to compare

@tindotdev tindotdev released this 24 Dec 15:17
· 424 commits to main since this release

Changes

  • Unified Billing: Migrate from direct OpenAI API key to Cloudflare AI Gateway Unified Billing
    • Replace OPENAI_API_KEY secret with CF_AIG_TOKEN
    • Use cf-aig-authorization header instead of Authorization
    • Single billing through Cloudflare credits

Configuration

Required Worker secret:

pnpm wrangler secret put CF_AIG_TOKEN

Prerequisites:

  1. Load credits in Cloudflare Dashboard → AI → AI Gateway → Credits
  2. Create Cloudflare API token with AI Gateway permissions
  3. Ensure AI Gateway append-gateway exists

Files Changed

  • packages/api/src/lib/suggestions.ts - Auth header and config interface
  • packages/api/src/routes/batch.ts - Bindings and validation
  • docs/adr/0006-openai-gpt-5-mini-via-ai-gateway.md - Updated to Unified Billing
  • docs/vertical-slice.md - Updated Step 3 config