Skip to main content
Each alias in LLM Gateway 2.0 has grants that decide who can call it and budgets that cap what they can spend. One grant governs each request, and that grant decides both access and which budget applies. The gateway records the estimated cost of every request so you can see where spend goes.

Grants

For each request, the gateway picks one grant. The most specific match wins, in this order:
  1. User grant
  2. Organization grant
  3. Service account grant
  4. All-users grant
  5. Bring your own token (BYOT) grant
If a user has a personal grant and the alias also has an all-users grant, the personal grant governs that user’s requests, including their personal budget. When a caller passes their own provider API key, the gateway uses the BYOT grant even if a more specific grant exists. The caller’s provider account pays, so gateway budgets for users and organizations don’t apply.

Callers in more than one organization

When several of a caller’s organizations have grants on the same alias, the gateway bills the grant with the most remaining budget first, and moves to the next one when it runs out. The organization that pays is the one that shows in usage reports. To bill a specific organization, send X-LLM-Tag-Bill-Org: <org-id>. The gateway ignores the header if the caller isn’t in that organization or the organization has no grant on the alias. The gateway caches organization membership for 5 minutes by default, so a newly added member may wait a few minutes before an organization grant applies. To change the cache duration, set DOMINO_USER_ORGS_CACHE_TTL_SECONDS. See Environment variables.

Pricing

Each alias uses either the gateway’s built-in price book or custom per-million-token input and output rates. Use custom rates for negotiated pricing or for self-hosted models the price book doesn’t list. The gateway prices prompt-cache reads and writes at cache rates. When the gateway forwards a batch job to the vendor’s own batch API, as it does for OpenAI, Azure OpenAI, and Anthropic aliases, it prices each line at half the regular rate to match the vendor’s batch discount. When the gateway runs a batch itself as individual requests to the provider, as it does for every other provider, it prices each line at the regular rate. An alias with custom rates can also set optional cache read and cache write rates per million tokens, which replace the model’s default cache pricing. Reasoning and image tokens may not be captured exactly, so the recorded cost is an estimate for budgets and usage reports.

Budgets

Two budgets can apply to a request, and both must pass:
  • An alias ceiling caps total spend through that alias, for every caller, including BYOT.
  • A grant budget caps spend for one user, organization, or service account grant. All-users and BYOT grants don’t carry budgets.
Budget periods are daily, weekly, or monthly. An empty budget field means unlimited. A budget of 0 denies every request. A user’s budget doesn’t draw from their organization’s budget. If a user with a $200 personal grant runs out, the gateway denies their requests, even if their organization’s grant on the same alias has money left. To force everyone onto a shared pool, clone the alias and put exception users on the copy.
Under heavy concurrent traffic, spend can go slightly over a budget before the gateway logs the requests that crossed it.

Rate limits

Each grant can carry three optional limits. Set them in Access Policies when you create or edit a grant, in the Requests / min, Tokens / min, and Concurrent requests fields. An empty field means no limit, and a value must be a positive integer. The grants table shows them in the Limits column. Limits apply to the grant the gateway selected for the request, the same way budgets do. A user grant limits that user, an organization grant is shared by the organization’s members, and an all-users grant is shared by everyone on the alias. A request over a limit gets a 429 response with error type rate_limit_error and a Retry-After header. This 429 ends the request on the primary alias or any link in a fallback chain. A budget_exceeded 429 still advances the chain and carries no Retry-After header. The gateway returns both 429 responses before it calls any provider. On the Anthropic-compatible endpoints (/anthropic/v1/*), which Claude Code uses, every 429 has error type rate_limit_error, so callers identify a budget denial by its message (Model-wide ceiling exhausted or Your budget exhausted) and by the missing Retry-After header. The limits apply to chat completions, responses, Anthropic messages, embeddings, and decision models. The gateway keeps the counts in memory, so a restart resets them. Claude Code retries a 429 on its own, so a concurrency cap of a few requests per user slows a runaway session and keeps it running.

Denied requests in the usage log

Every budget or rate-limit denial writes a usage log row with status 429, the denial reason as its error message, and zero tokens and cost. In the Logs view, the row carries a denied:<limit> tag, where the limit is rpm, tpm, concurrency, alias_ceiling, or grant_budget. Select Denied requests only to filter to these rows and see who hits which limit before you change it. The gateway writes the first denial for a user, alias, and limit at once. Further denials in the next 10 seconds become one row that states how many denials it stands for, with a tag such as denied:rpm ×57. To change the window, set LLM_GATEWAY_DENIAL_LOG_WINDOW_S in the environment variables. A value of 0 writes one row per denial. Denial rows count as requests and errors in usage statistics. They don’t count toward spend, a tokens-per-minute window, or provider health. When a fallback chain moves past a budget denial, the chain’s skip row records it once.

Gateway admins

The App owner and any Domino Admin or SysAdmin can manage providers, aliases, grants, and settings. To give another user admin rights, add them under Access Policies > Gateway Admins. Promoted admins can do everything except change the admin list.

Track usage and cost

Admins see Usage & Cost, covering all traffic. Other users see My Usage & Budgets, the same panel scoped to their own requests.

Break down usage

Use Breakdown by to slice the charts and table by model, provider model, user, organization, token name, or any custom tag. Tags come from X-LLM-Tag-<key>: <value> headers on /v1/* requests. Tag filters narrow the whole panel and combine with AND. The table shows either aggregate rows, with a $ / 1K tokens column for comparing cost efficiency, or individual requests. Click a request’s cost to see what it’s made of. Charts show the top 8 groups by cost and roll the rest into “Other”. The table lists every group.

Share a view

The panel state lives in the URL, so you can share a view:

What users see

On the user view, totals, tag keys, and tag values cover only the caller’s own requests. A link an admin shares shows a user smaller numbers. The user view always reads the gateway’s local data. That data covers the panel’s full 90-day range unless an admin sets log retention below 90 days. See Purge old logs. To query usage from your own Data Source, mirror logs to a warehouse.
Last modified on November 19, 2026