AI API budget limits and spend per key
Standard Compute puts a hard budget on every API key. Each person and each app gets its own key with a fixed monthly budget that never overruns, and you can set spending caps per key and for the whole company.
Give every service or code path its own key and Standard Compute attributes AI API spend to it automatically: the free usage report shows requests, tokens and cost per key and per model.
AI API budget limits per key and per company
How spend control works on a Standard Compute company account.
| Control | Standard Compute |
|---|---|
| Budget per key | Standard Compute: Every key has a fixed monthly budget equal to its plan price. |
| At the budget | Standard Compute: The key's requests are refused with HTTP 402. There is no overage. |
| Keep critical agents running | Standard Compute: Optional top-off from a prepaid company balance until the plan renews. |
| Pay as you go caps | Standard Compute: Monthly spending caps per key and for the whole company. |
| Shared budget | Standard Compute: A person's keys can share that person's budget. |
| Models per key | Standard Compute: Each key has its own list of approved models. Requests for other models are rejected. |
| Spend attribution | Standard Compute: A free usage report with requests, tokens and cost per key and per model. |
| Request records | Standard Compute: Metadata only: model, provider, tokens, cost and status. Never prompts or outputs. |
| Admin changes | Standard Compute: Every change to people, keys, budgets and rules is recorded with before and after values. |
Attribute AI API spend to specific code paths
Spend attribution on Standard Compute follows the key. Create one application key per service, job or code path, and every request that key makes is counted against it: requests, tokens and cost, split by model.
There is no tagging to maintain in the code. Moving a code path to its own key is a one-line configuration change, and from then on its cost appears on its own line in the usage report.
| Key | Used by | What the usage report shows |
|---|---|---|
support-assistant | Used by: Customer support service | What the usage report shows: Requests, tokens and cost per model for that service |
nightly-summaries | Used by: Batch job | What the usage report shows: The job's monthly cost, separate from live traffic |
jane@yourcompany.com | Used by: One developer's Claude Code | What the usage report shows: That person's usage against their own budget |
Use the OpenAI SDK and enforce cost caps behind the scenes
Applications keep the OpenAI SDK. Point its base URL at Standard Compute and use the key you issued for that app. The cap, the approved models and the budget live on the key, so a runaway loop stops at the budget and nobody has to change code to tighten it.
from openai import OpenAI
# One key per service: it carries the budget
client = OpenAI(
base_url="https://api.stdcmpt.com/v1",
api_key="SC_KEY_FOR_BILLING_SERVICE",
)
reply = client.chat.completions.create(
model="anthropic/claude-sonnet-5.5",
messages=[
{"role": "user", "content": "Hi"},
],
)OpenAI spending limits and hard budgets per key
A budget is only useful if it holds. On Standard Compute the budget is the plan, and the key stops when it is used, with no overage. Critical agents can keep running on top-off from a prepaid company balance, which you turn on per key.
Decide which models each key can use, so every app and every person gets exactly the models you approve.
Questions from IT, security and finance
- What happens when a key reaches its budget?
- Its requests are refused with HTTP 402 until the plan renews, unless top-off from the prepaid company balance is turned on for that key.
- Can we cap total AI spend for the whole company?
- Yes. Pay as you go has a monthly cap for the whole company as well as per key, and every plan key has its own fixed budget.
- How do we see which service spends the most?
- Give each service its own key. The free usage report shows requests, tokens and cost per key and per model.
- Do request records include prompts?
- No. Request records hold metadata only (model, provider, tokens, cost and status), never your prompts or outputs.
- Can we restrict which models a key may use?
- Yes. Each key has its own list of approved models, and requests for other models are rejected.