Skip to main content

Per AI tool limits

Since v1.113.0

Set a separate USD limit for each coding tool a team uses. A team limit pools spend from all requests billed to the team, including those made with a team key that has no member. A member limit caps one person's spend for the same tool. When you set both, LiteLLM checks both before it admits the request.

If a member reaches their Claude Code limit, LiteLLM blocks new Claude Code requests for that member on that team. If the team reaches its shared Claude Code limit, LiteLLM blocks new Claude Code requests for everyone on the team. Cursor can still work if the request passes its own limits and the other proxy limits.

LiteLLM recognizes tools such as Claude Code, Cursor, GitHub Copilot, Codex, OpenCode, Antigravity, and Gemini CLI from the request's User-Agent header. You can also set limits for other client products once LiteLLM has recorded their spend.

Set a limit in the dashboard​

Open Teams and select a team. To set a shared limit, open Overview and find Per AI tool limits in Budget Status.

Team Overview showing Per AI tool limits inside Budget Status, with the shared Claude Code limit and default per member

To set an individual limit, open Members and click the member's cell in the AI tools column. You can also use the row's edit action. Both open Edit Member, where Per AI tool limits sits below the overall member budget and reset period.

Edit Member showing Per AI tool limits below the overall budget and reset period, with Cursor at its limit

If the member has no limits, select Set limits in the AI tools column to open Edit Member. When a team or member has no limits, Add limit opens the list of tools you can configure.

Choose Set limit next to a tool, enter an amount in USD, then select Save next to that limit. If the tool has no spend or limit, expand Tools with no spend or limit to find it.

To change or remove a limit, choose Edit limit. Clear the shared amount and save to remove the team limit. A limit of 0 blocks requests for that tool.

In Budget Status, use Default per member (USD) to set an individual limit for each member without an override. In Edit Member, look for Team default or Member override next to the tool. Clear a member override and save to restore the team default. The shared team limit still applies.

Choose a daily, weekly, or monthly Reset period to count spend in the current period. Check the tool's row for the next reset date. Leave the period set to Never to use cumulative spend. A team reset period applies to the shared limit; members can set their own periods.

Monitor spend​

On Members, scan the AI tools column for tool logos and spend. An amber dot marks a tool near its limit. A red dot marks a tool at or above its limit. Click the cell to see all the member's tools and limits.

Members table with tool logos, spend, and a red dot next to Cursor in the AI tools column

Use Per AI tool limits in Edit Member for a member's spend, or in Budget Status for spend across the team. For example, $0.18 of $0.16 means the tool has passed its limit. Look for Near limit at 80% and At limit at 100% or more. Read amounts to two decimal places; <$0.01 means a nonzero amount below a cent. LiteLLM does not backfill earlier member spend into team tool totals.

Choose View usage on a tool's row to open Usage for that tool, or View usage for all AI tools to see them together. Usage starts with the same team and member scope as the link. Select Clear filters to return to unfiltered Usage. Usage covers the dates you select; Per AI tool limits shows the spend counted toward each limit.

When budget alerts are enabled, LiteLLM alerts at 80% and at the limit. Each threshold alerts once per tool, scope, and period. A charge that goes directly past the limit sends the limit alert.

Set or read a limit through the API​

Use a proxy admin key or credentials with team or organization admin access. Both scopes support GET and PUT. Use /team/TEAM_ID/ai_tool_budgets for a team, or /team/TEAM_ID/member/USER_ID/ai_tool_budgets for a member. Replace TEAM_ID and USER_ID with the team's and member's IDs.

Set LITELLM_URL to your proxy URL and LITELLM_API_KEY to your key. This example lists the team's tool budgets and sets its shared Claude Code limit to $25.

endpoint="${LITELLM_URL}/team/TEAM_ID/ai_tool_budgets"

curl -sS "$endpoint" \
-H "Authorization: Bearer $LITELLM_API_KEY"

curl -sS -X PUT "$endpoint" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tool_id":"claude-code","max_budget":25,"default_member_max_budget":10,"budget_duration":"7d"}'

Both calls return the recorded rows for that scope, including tool_id, spend, max_budget, budget_duration, and budget_reset_at. Member rows identify a team_default or override in limit_source. For an observed custom client, copy its tool_id, for example user-agent:customclient. Send "max_budget": null to remove a shared limit or a member override. Send "default_member_max_budget": null to remove the team default. Send "budget_duration": null to use cumulative spend again.

Know what the limit covers​

Clients supply their own User-Agent, so they can spoof it. Treat tool budgets as cost controls for clients you manage, not as proof of a client's identity.

Tool resets are independent of the team's overall budget. Periodic tracking begins when you set the period; LiteLLM does not backfill earlier charges into that period. LiteLLM checks recorded spend before admitting a request and records the cost afterward. A request admitted below the limit can take spend over it, and the dashboard can briefly lag enforcement while spend updates flush.

LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →