James Washington
writing about archive utils free game ideas replays
Technique

Separate flat-rate and metered Claude routes in an LLM gateway

Keep the subscription-covered AI and the pay-per-use AI clearly separate so you don't get surprise bills.

Cloudflare and the edge

how it works

Unsuffixed gateway models carry no api_key and only accept a client's own OAuth token (cost 0); '-api' models use a metered key; leaving ANTHROPIC_API_KEY set silently switches Claude Code to metered billing.

Technique: A pattern or hard-won lesson, written down so it isn't learned twice.

The code for this one lives in a private repo. This page explains the idea so you can build your own.

anthropicbillinglitellmtechnique

related

  • Marked-up LLM gateway with per-client virtual keys and Stripe invoicing API A private AI service that lets a consultancy give each client their own AI key and bill them monthly for exactly what they used.
  • agent-merge: Jev-gated self-merge for agent branches Automation The one sanctioned way an AI may merge its own work: a script that reviews it first and refuses if it didn't show its work.
  • claude-bridge API Lets any chat app that speaks the OpenAI format use my Claude subscription.
  • Code-owns-workflow, models-supply-judgment outreach pipeline Automation A program that researches leads and writes draft sales emails for a person to approve, never sending anything itself.
  • OpenClaw agent gateway (vault project page) Note Notes on an AI gateway that routes requests across several AI providers with automatic fallbacks.
← everything I've built
© 2026 James Washington
github twitter rss