Skip to main content

Set usage limits and cost control

This guide shows administrators how to cap token volume and spend in DIAL by attaching limits to roles in DIAL Admin. It assumes you manage a DIAL deployment and have write access to the Access management section. To understand the model behind these controls first, read Usage limits and cost control.

How limits attach to roles​

DIAL enforces limits through roles, not on individual users. A role carries both token rate limits and cost limits, and those limits apply to every subject — a user, a group, or an API key — that holds the role. DIAL Core checks each request against the applicable limits before it reaches a model, and rejects requests that exceed an allowance until the window resets.

DIAL applies two independent controls:

  • Token rate limits cap the number of tokens consumed within a time window (per minute, day, week, or month). Daily, weekly, and monthly limits follow calendar periods (calendar day, ISO week, calendar month) rather than rolling windows.
  • Cost limits cap actual spend across every model the role can reach, accounting for each model's pricing automatically. Cost calculations include cache read and cache write pricing when configured on the model.

Set role-wide token limits​

  1. Open Access management > Roles and select the role to edit. See Manage roles for the full role configuration.
  2. On the Properties tab, use Set cost limits to define the token allowance: Tokens per minute, Tokens per day, Tokens per week, and Tokens per month.
  3. Click Save.

Note

If a role has no limits set, the limits configured for the default role apply. If the default role has no limits either, the allowance is unlimited.

Set per-entity token limits​

A role can grant different allowances for different models and applications.

  1. Open the role and switch to the Entities tab.
  2. Add the models or applications the role may access.
  3. For each entity, set Tokens per minute, Tokens per day, Tokens per week, or Tokens per month. Use Set unlimited to remove the cap for selected entities.
  4. Click Save.

Set sharing limits​

The Sharing field on the Properties tab limits how resources granted by the role can be shared:

  • Expiration time — the time-to-live of a sharing link. Default: 72 hours.
  • Max users — the maximum number of users who can accept a sharing link. Default: 10 for applications, unlimited for other resource types.

Verify and monitor​

After saving, DIAL Core records every limit check. Track consumption against configured limits on the monitoring dashboards, and adjust allowances to match real demand.

Result

Requests from any subject holding the role are now metered against the token and cost limits you set, and rejected when an allowance is exhausted.

Further reading​