Cookbook
The cookbook collects end-to-end recipes. Each one starts from a situation you are likely in — an app already built on the OpenAI SDK, a team on OpenRouter, a product that resells AI to its own customers — and walks you through the exact changes, with code you can copy. Every recipe uses the same base URL, https://api.belarel.com/v1, and reads your key from the BELAREL_API_KEY environment variable.
Migrate an existing integration
Section titled “Migrate an existing integration”Migrate from OpenAIChange the base URL and the key, then check the handful of behaviors that differ.
Migrate from OpenRouterWhat carries over, what has no equivalent, and what Belarel adds on top.
Vercel AI SDKUse generateText and streamText from @ai-sdk/openai against Belarel.
Run it in production
Section titled “Run it in production”One sub-key per customerMint a capped, tagged key for each of your end customers and track what each one spends.
Spend control patternsCaps, sandbox keys in CI, safe retries, monitoring, and the cap-reached webhook.

