Employee AI spend management covers both purchased subscriptions and usage charged through API keys. A team can pay for unused seats while the same employees incur separate model charges, so start with an inventory of both.
A developer can use Claude Code through an Enterprise account, an Anthropic API key, or a gateway backed by the company's cloud account. A limit on one route does not automatically cover the others. Codex has the same billing distinction between ChatGPT workspace access and API-funded requests.
Identify who pays for each route, configure the provider's spend controls, and use an employee-aware gateway where you need one API budget across providers. The instructions below were checked against official documentation on October 26, 2026; availability depends on the plan and deployment. Dollar amounts in examples are illustrative allowances, not vendor prices.
1. Match the control to the billing route#
Record each tool's sign-in method, billing organization or project, owner, and permitted route. In Claude Code, run /status and check the active authentication. An approved ANTHROPIC_API_KEY can take precedence over a subscription login; non-interactive -p use also needs checking. See Anthropic's authentication guidance.
| Where usage is billed | Native budget boundary | Where to configure | API / automation |
|---|---|---|---|
| Claude Enterprise | Member, group defaults, organization; pooled groups in beta | Organization settings → Usage | Per-user overrides; org/group defaults and pools stay in UI |
| Anthropic Console/API | Organization and workspace; special Claude Code workspace has per-user limits | Workspace → Spend limits | Org/workspace spend-limit writes are early access |
| ChatGPT workspace/Codex | Eligible per-user usage; separate workspace overage | Global Admin Console/workspace settings | Admin API user limits, subject to enrollment |
| OpenAI API | Organization and project, covering their keys | Limits → Spend → Enforce a hard limit | Organization/project spend-limit API |
| Gemini API or Google Cloud | Project; Cloud enforcement selects one service | AI Studio Spend or Cloud Billing budgets | Cloud Budget API for eligible project/service caps |
| OpenRouter | Key/member; pooled workspace budgets on Enterprise | Workspace Guardrails and Budgets | Management API; workspace pools require Enterprise |
| LiteLLM Proxy | Team, team member, key, or authenticated end user | Teams, Internal Users, Virtual Keys | Management API; database required |
The sections below link to each control's documentation. Keep seat fees and committed credits separate from incremental API charges. A token count, rate limit, or alert is not itself a dollar cap; even enforced caps can permit costs from in-flight work or delayed accounting.
Account for subscriptions and shadow AI#
Compare card and expense transactions with identity-provider and SaaS records. For each AI subscription, record its owner, employee or team, renewal date, seat fees, and metered charges. Require approval before a new purchase and review duplicate subscriptions. Our shadow AI detection guide covers finding usage outside approved accounts.
Review paid seats. In the Microsoft 365 admin center → Reports → Usage → Microsoft Copilot → Copilot → Usage, compare Enabled Users with Active Users over the selected period. Review low activity with team owners before reclaiming licenses. This is an adoption report, not a dollar cap. See Microsoft's report instructions.
Control new purchases. In Ramp → Funds & cards → Issue funds, create a virtual card with an amount, reset frequency, and allowed merchants. Assign an owner and review it before renewal. See Ramp's admin guide. Card controls govern payment transactions; pair them with provider or gateway limits because usage can accrue before the vendor charges the card.
See how your AI systems hold up under real attacks
General Analysis maps AI applications and agents, red teams prompts, retrieval, tools, MCP servers, browser actions, permissions, and business workflows, then turns findings into evidence your team can reproduce and retest.
2. Configure Claude Code and Anthropic limits#
Claude Enterprise. In Organization settings → Usage, configure the organization ceiling and member allowances. Under By group/tier, open a group's menu → Edit limits → set Member limit → Save. This gives each member an allowance; it does not pool the group's spending. Individual settings are under By member → Spending defaults.
An individual override takes precedence. For members in multiple groups, Spending defaults → Member limit from groups chooses the higher or lower group limit. Where available, the beta Pooled monthly budget setting creates a shared group balance alongside Member monthly limit. Usage can go slightly beyond a limit before pausing. See the Enterprise consumption guide and group configuration.
The Spend Limits API can write Enterprise per-user overrides. Use a scoped Admin key with write:spend_limits; read:spend_limits allows inspection. This documented request shape sets a $500 monthly override, expressed as a string in USD cents. Follow the source's authentication and organization prerequisites.
Code source: Anthropic Spend Limits API; adapted request body with a placeholder user ID.
POST /v1/organizations/spend_limits
Content-Type: application/json
{
"scope": {"type": "user", "user_id": "USER_ID"},
"amount": "50000",
"period": "monthly"
}
Read /v1/organizations/spend_limits/effective to inspect the resolved limit and inheritance. Enterprise organization/group defaults and pools remain UI-managed.
Anthropic API keys. Go to Console → Settings → Workspaces, select the workspace, then Spend limits to set its monthly cap and alerts. Ordinary workspace limits cover the workspace's traffic, not an individual employee. The dedicated Claude Code workspace is the documented exception with per-user limits. Console organization/workspace spend-limit API writes are early access; confirm access before automating them. See workspaces and the endpoint's eligibility notes.
3. Configure Codex and OpenAI API limits separately#
Codex billed through ChatGPT. In the Global Admin Console or workspace settings, review eligible usage and set monthly user defaults, group defaults, or individual overrides. A group default is a per-person allowance. An individual override wins; otherwise, the highest applicable group limit applies. Separately configure workspace overage and alerts. Where supported, a zero overage limit stops eligible usage after committed credits run out. Check your agreement's credit or USD units. See workspace administration and usage and cost.
There is also an actual write API: PATCH /v1/manage/workspaces/{workspace_id}/usage_limits/users/{user_id} with override_monthly_usage_limit. A temporary override sets the person's total monthly cap, not extra capacity, and expires at period end. Follow the official Admin API recipe for enrollment, authentication, and the request body. The Analytics API is a separate reporting surface.
Codex or applications billed to OpenAI API keys. Configure a hard cap in Organization limits → Spend → Edit spend limit, or Project settings → Limits → Spend → Edit spend limit. Set the monthly amount, turn on Enforce a hard limit, and save. These controls govern API billing, independently of ChatGPT workspace limits. See OpenAI's spend-limit guide.
An appropriately authorized Admin API key can set a project cap. This request shape sets $100 per month; threshold_amount is cents.
Code source: OpenAI project spend-limit API; adapted with a placeholder project ID.
POST /v1/organization/projects/PROJECT_ID/spend_limit
Content-Type: application/json
{"threshold_amount": 10000, "currency": "USD", "interval": "month"}
The organization counterpart is /v1/organization/spend_limit. A reached cap returns a 429 spend-limit error, but enforcement propagation can permit slight overshoot. A project cap covers all keys billing to that project. Use separate projects for independent budget boundaries, or gateway identity for employees sharing a project.
4. Add Gemini project caps where needed#
For Gemini API, open AI Studio → Spend → Monthly spend cap → Edit spend cap. Monitor consumption under Dashboard → Usage. This cap is per project, not per API key or employee. The feature is experimental, has a processing delay of about ten minutes, and long-running work can exceed the cap. Invoiced/Offline accounts are excluded. See Gemini billing.
For supported Google Cloud billing, go to Billing → Budgets & alerts → Create budget, choose Spend cap enforcement, then select one project and one eligible service, a monthly period, and an amount. Choosing Alerts only does not enforce a cap. The documented services include Gemini API (generativelanguage.googleapis.com) and the Vertex AI/Gemini Enterprise Agent Platform service (aiplatform.googleapis.com).
New usage pauses when estimated gross spending exceeds the limit; in-flight work and continuing compute/storage charges can still create costs. Check account eligibility and the additional spend-cap IAM permission. See Cloud spend caps.
Automation uses POST https://billingbudgets.googleapis.com/v1/billingAccounts/BILLING_ACCOUNT_ID/budgets. Use the complete spend-cap request schema, including project-number/service-ID filters, amount, and spendCap.inputState: "CONFIGURED"; that flag alone is insufficient. Creating an ordinary budget does not enforce a cap. Gemini API quotas are also shared per project, so handing each employee a different key does not create separate budgets. For Gemini CLI, confirm whether it uses Google sign-in, a Gemini API key, or Vertex AI; billing and quotas follow that route.
5. Enforce employee and team budgets across providers#
For a shared API budget, route permitted Anthropic, OpenAI, and Google requests through a gateway that authenticates the employee and checks both employee and team balances. Keep upstream provider credentials on the gateway. Distributing one shared gateway key does not identify employees. Bind keys to people, or have authenticated middleware supply a trusted employee identity.
OpenRouter#
In Workspaces → selected workspace → Guardrails, create a spending guardrail, choose its USD limit and reset interval, then save and assign it to the intended member or key. Unassigned guardrails do nothing. Member attribution follows keys that member created; it does not discover who used a shared admin key. Assigning the same guardrail to several members gives each a separate allowance.
For a pooled team cap, Enterprise workspaces provide Settings → Budgets → Add budget. An organization admin can set daily, weekly, monthly, or lifetime balances. Automation uses PUT /api/v1/workspaces/{workspace_ref}/budgets/monthly with {"limit_usd":1000} and an organization management key. An exhausted applicable workspace budget blocks requests with 403, subject to in-flight overshoot. See workspace budgets and spend controls.
BYOK spend is excluded by default. Enable Include BYOK spend on both the workspace budget and relevant guardrail if those requests belong in the allowance. OpenRouter's recorded inference cost can differ from negotiated provider invoices. For key limits, use POST /api/v1/keys or PATCH /api/v1/keys/{hash} with a Management API key. Their fields are limit, limit_reset, and include_byok_in_limit.
LiteLLM Proxy#
Run the proxy with PostgreSQL. Budgets on a database-less deployment do not enforce spending. Use Teams, Internal Users, and Virtual Keys in the Admin UI, or the API, to bind keys to people and teams.
For example, create a $600 Engineering team budget for 30 days, add an existing employee to that team, then give that member a $100 allowance and issue their team-bound key. These are administrative request shapes, not a script to run unchanged:
Code source: LiteLLM team budgets and team-member budgets; illustrative amounts and placeholder IDs.
POST /team/new
{"team_alias":"Engineering","max_budget":600,"budget_duration":"30d"}
POST /team/member_update
{"team_id":"TEAM_ID","user_id":"USER_ID","max_budget_in_team":100,"budget_duration":"30d"}
POST /key/generate
{"team_id":"TEAM_ID","user_id":"USER_ID"}
Add the member to the returned team before /team/member_update. 30d is a 30-day window, not a calendar month. Team keys enforce team and team-member budgets; the owner's personal user budget does not also apply. For one employee cap across several teams, configure an end-user/customer budget and derive its stable identity from trusted authentication, not caller-chosen text.
Keep budget reservation enabled. For fail-closed enforcement, set general_settings.fail_closed_budget_enforcement: true; LiteLLM rejects requests with 503 when it cannot verify spend. Do not classify paid models as zero-cost fallbacks: those skip budget checks. Validate the deployed version and workloads whose full cost cannot be reserved, including batches.
Route the clients, not just the dashboard#
Distribute Claude Code's gateway URL and employee credential through managed settings and secret delivery. Anthropic documents ANTHROPIC_BASE_URL and managed allowedProviders: ["customEndpoint"] to pin an approved custom endpoint. Codex supports a configured gateway provider; validate Responses API streaming and tools, not just a basic chat request.
Supported Claude Code and Codex gateway paths can preserve subscription authentication. Routing does not automatically move subscription billing into an API budget. The worked example above standardizes API-funded routes. Verify the actual upstream payer and prevent alternative credentials or direct routes from bypassing the intended allowance. Our Claude Code security guide covers the surrounding managed settings and credential boundary.
6. Test the limit and assign an owner#
Before rollout, use small test allowances and verify:
- Individual exhaustion: the next eligible request is blocked, with a useful error and an attributable record.
- Shared exhaustion: multiple employees consume one team balance; verify later calls stop when it is depleted and record any overshoot.
- Concurrency and retries: parallel calls, delegated work, provider fallbacks, and retries keep the same employee/team identity.
- Bypass and failure: direct provider keys and alternate sign-in paths cannot escape policy; test an unavailable gateway budget store.
- Reset and exceptions: verify period resets and accrued-spend handling. Confirm which overrides expire; schedule and test reversals for permanent increases.
Finance owns allowances, developer platform owns routing and credentials, and team leads approve exceptions. Review invoices alongside gateway/provider records; include seats and commitments once. Keep per-run time, retry, and call limits for agents, and judge efficiency by useful completed work rather than raw token consumption.
Sources and further reading#
- Anthropic: Claude Code authentication, reviewed October 26, 2026.
- Anthropic: Enterprise consumption guide, reviewed October 26, 2026.
- Anthropic: Spend Limits API, reviewed October 26, 2026.
- Anthropic: Workspaces, reviewed October 26, 2026.
- OpenAI: Workspace usage and cost, reviewed October 26, 2026.
- OpenAI: Admin API usage-limit example, reviewed October 26, 2026.
- OpenAI: API spend limits, reviewed October 26, 2026.
- Google: Gemini API billing, reviewed October 26, 2026.
- Google Cloud: Budget spend caps, reviewed October 26, 2026.
- OpenRouter: Workspace budgets, reviewed October 26, 2026.
- OpenRouter: Spend controls, reviewed October 26, 2026.
- LiteLLM: Budgets and rate limits, reviewed October 26, 2026.
- LiteLLM: End-user budgets, reviewed October 26, 2026.
- Google: Gemini CLI authentication, reviewed October 26, 2026.
- Microsoft: Copilot usage report, reviewed October 26, 2026.
- Ramp: Admin guide, reviewed October 26, 2026.
