ospalabs
Guide · Azure OpenAI

How to put a hard spending limit on Azure OpenAI

Updated October 2026

Azure Cost Management budgets send alerts; they don't stop an Azure OpenAI deployment. Microsoft's own answers point to workarounds: a budget alert that triggers an automation runbook to disable access, or Azure API Management in front of the service with a cost policy. Both take building, and budget data can trail real usage by up to a day.

Fuse gives you the ceiling without building it: Azure's v1 API speaks the OpenAI protocol, so you can add it to a Fuse project as a custom provider and enforce a dollar limit per request.

  1. 01

    Keep an Azure budget alert anyway

    Set a Cost Management budget on the subscription or resource group with alerts. It covers anything that doesn't go through Fuse.

  2. 02

    Use the v1 endpoint

    Azure OpenAI's v1 API is OpenAI-compatible and takes your resource key with the standard OpenAI client. The base URL is your resource's endpoint plus /openai/v1, for example https://my-resource.openai.azure.com/openai/v1.

  3. 03

    Add it to Fuse as a custom provider

    In your Fuse project, open Providers & models, add a custom provider with that base URL and your Azure key, and add a model for each deployment name you call, with its price per million tokens. Fuse uses those prices to check each request.

  4. 04

    Set the ceiling and point your app at Fuse

    Set a daily or monthly ceiling on the project, create a Fuse key, and swap the base URL and key in your app. The model field is the deployment name, as before.

    .env
    FUSE_BASE_URL=https://fuse.ospalabs.com/v1
    FUSE_API_KEY=fz_your_fuse_key
  5. 05

    Make sure nothing bypasses it

    Don't hand the Azure key to apps any more; rotate it after the switch so old copies stop working. Network restrictions on the Azure resource add another layer.

Questions

Does this work with Entra ID (Azure AD) authentication?
Custom providers in Fuse use an API key. If your resource only allows Entra ID tokens, Fuse can't call it.
Where do the prices come from?
You enter them for each deployment when you add it. Use your Azure price sheet, including any regional or provisioned pricing.
Aren't Azure's TPM quotas a limit?
They limit tokens per minute, not dollars per day. A deployment running at its quota around the clock can still produce a large bill.