Budget AI
Budget AI is the AI gateway built into ANTS Platform. Your applications and agents call a single OpenAI-compatible endpoint with an ANTS-issued key. Budget AI checks the key, applies rate limits and budgets, picks a provider deployment, retries or fails over when a provider has trouble, and records the request as a trace in your project with its cost.
What it does
| Capability | What you get |
|---|---|
| One endpoint | https://<your-gateway-host>/v1 speaks the OpenAI API: chat completions (streaming and non-streaming), embeddings and a model list. Any OpenAI SDK works by changing the base URL and key. |
| Many providers | OpenAI and any OpenAI-compatible API, Azure OpenAI, Anthropic, AWS Bedrock and Google Vertex AI (including a Gemini API key), or Portkey as an upstream gateway. See Providers & Credentials. |
| Model groups and routing | Applications call a name you choose, such as prod-chat. Behind it you place one or more provider models, a routing strategy, retries, cooling-off for failing deployments and fallback groups. See Model Groups & Routing. |
| Keys | Keys that expire after hours or days, are limited to named model groups, can be confined to source networks, can be bound to an agent, and can be rotated, blocked and deleted. Short-lived keys for an agent can be minted by API. See Keys. |
| Guardrails | Optional inline inspection of requests and responses, streamed or not, with the agent's AI Guardrails policy: block, redact, warn or audit, with fail-open or fail-closed per project. Off by default; switched on per project or per key. See Guardrails. |
| Limits and budgets | Requests and tokens per minute per key and per project, and daily, weekly or monthly budgets per key, tag, org unit and project, with hard stops or alerts. Each project budgets in dollars or in tokens; a tokens project can add a dollar cost ceiling, and a hard token budget can lower a request's output limit to the tokens left instead of refusing it. See Budgets & Limits. |
| Tracing and cost | Every request that reaches a known key becomes a trace with cost, usage, latency and routing detail, and can carry user, session, tags and metadata. See Observability & Cost. |
How it fits with the rest of ANTS Platform
Budget AI writes its traces through the same ingestion path as the SDKs and OpenTelemetry. Gateway traffic therefore appears in Tracing, Sessions, Users, dashboards and cost reporting next to the rest of your AI traffic, priced with your project's model prices. Each gateway trace carries the gateway tag and a Gateway panel that shows the key, model group, deployment and attempts. Requests made with a key bound to an agent are recorded under that agent, so their cost shows for the agent in Agent Cost Analysis and the AI Agent Center.
Spend control happens before the provider is called. A request that would exceed a hard budget or a rate limit is refused and never reaches the provider.
Where to find it
| Place | What is there |
|---|---|
| Budget AI → Overview | Traffic, spend, errors, refusals, budgets, busiest keys and model health for the project |
| Budget AI → Keys | Issue, rotate, block, unblock and delete keys; per-key traffic and spend |
| Budget AI → Budgets & Limits | Budgets, spend, threshold crossings and the org unit Hierarchy |
| Budget AI → Models & Routing | Provider credentials, model groups, deployments, routing, fallbacks and cache |
| Budget AI → Access | Budget AI roles: who is a Platform Admin, Platform Viewer, Department Owner or Department Viewer |
| Project Settings → Budget AI | Turn serving on or off, the gateway address and SDK snippets, the budget unit and cost ceiling, key expiry policy, project rate limits, minimum capped output, AI Guardrails inspection, provider secret storage and health checks |
| Organization Settings → Budget AI | Every project with Budget AI enabled, with requests, cost, error rate and spend against budget over the last 24 hours |
What you need to turn it on
Budget AI appears only when all of these hold:
- Plan entitlement. The organization's plan includes the
llm-gatewayentitlement. It is part of the Enterprise plan on ANTS Cloud and of an Enterprise self-hosted license. - Feature flag. The
gatewayAifeature flag is enabled for the user. Instance administrators, and deployments that setLANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=true, see it without the flag. Contact your account team to have it enabled. - Product module. The
gatewayproduct module is not hidden for the deployment (for example throughLANGFUSE_UI_HIDDEN_PRODUCT_MODULES). - The gateway service. On ANTS Cloud it is operated for you. On a self-hosted deployment, enable the Helm subchart with
gateway.enabled: trueand setglobal.gateway.publicBaseUrl. See Self-Hosting & Configuration. - Permissions. The user holds the Budget AI permissions for what they want to do. See Access control.
- Per project. An administrator turns on Serve gateway traffic for this project in Project Settings → Budget AI. It is off for a new project.
The checks in steps 1 to 3 are enforced on the server for every Budget AI action, not only in the navigation. The gateway itself serves a project only while serving is on and the organization holds the entitlement.
Budget AI screens carry no beta label. Access is still granted per user through the gatewayAi feature flag.
Access control
Budget AI permissions are part of the Budget AI module in roles and custom roles. Each page has its own permission scope:
| Scope | Allows |
|---|---|
gatewayAi.overview:read | View the Overview page |
gatewayAi.keys:read | List keys and outstanding collection links, see key traffic |
gatewayAi.keys:write | Issue keys and collection links, rotate keys, change a key's allowed networks |
gatewayAi.keys:admin | Block, unblock and delete keys, and suspend and resume agents |
gatewayAi.budgets:read | View Budgets & Limits, the Hierarchy and a key's effective limits |
gatewayAi.budgets:admin | Create, edit and delete budgets and org units, move keys between org units, issue a key into an org unit |
gatewayAi.models:read | View provider credentials (masked), model groups and deployments |
gatewayAi.models:admin | Add, change, rotate, move and delete credentials; manage model groups, deployments, routing, fallbacks and cache |
gatewayAi.settings:read / gatewayAi.settings:admin | View or change Project Settings → Budget AI. Admin also sets a key's AI Guardrails mode. |
tenantSecurity.gatewayKeys:admin | Block and unblock keys, and suspend and resume agents, during an incident, without any other Budget AI access |
Built-in roles:
| Role | Budget AI access |
|---|---|
| Owner | Admin on every page |
| Department Admin | Admin on every page |
| Security & Compliance | Read on every page, plus block and unblock keys and suspend and resume agents through tenant security |
| Cost Analyst | Read on every page |
| Auditor | Read on every page |
| Manager Viewer, End User | No access, unless given a Budget AI role |
| None | No access |
To give someone a narrower set, for example keys only, create a custom role and set the Budget AI pages individually, or give them a Budget AI role.
Budget AI roles
Budget AI → Access assigns Budget AI roles per project. A department role applies to one org unit and every unit beneath it, never to a parent or sibling unit.
| Capability | Platform Admin | Department Owner | Department Viewer | Platform Viewer |
|---|---|---|---|---|
| Provider credentials | Create, edit, rotate, delete | Hidden | Hidden | View |
| Model groups and routing | Manage | View | View | View |
| Top-level org units | Create | No | No | No |
| Sub-units | Create anywhere | Under their unit | No | No |
| Budgets | Assign and change | View own unit and below | View own unit and below | View all |
| Usage and spend | All | Own unit and below | Own unit and below | All |
| Keys | All | Issue and manage in own unit and below | View, masked | View, masked |
| Assign roles | Yes | No | No | No |
| Playground | Yes | No | No | No |
How a member's Budget AI access is decided:
- A member with no Budget AI role keeps the access their project role gives them, as in the table above.
- A member with a Budget AI role gets their Budget AI access from that role only. Their project role still decides everything outside Budget AI.
- Project Owners are always Platform Admins and cannot be given a narrower role.
- A Department Owner issues keys only into their units, cannot put a budget on those keys, and can rename their own unit but not move or delete it. Budgets set above their unit show as Parent unit.
- Asking for a key or unit outside a department role's units returns "not found".
To assign a role, select Assign role, choose the Member, the Role and, for a department role, the Org unit, and complete step-up verification. Removing a role is done from the same table. Assigning roles needs a Platform Admin, or gatewayAi.settings:admin for a member with no Budget AI role. Nobody can change their own Budget AI role, and only an Owner can remove a Platform Admin. Every assignment and removal is written to the audit log (resource type gatewayRoleAssignment), and takes effect on the member's next page load.
In this section
For capabilities that are planned but not yet available, see the Roadmap.