Cap what an API key spends
Found this helpful? Share it:
Found this helpful? Share it:
A key you hand to an agent is a blank check unless something bounds it. In idapt, the bound lives on the key itself: a hard USD cap, enforced on every metered endpoint across all three compatible APIs.
Window | What it bounds |
|---|---|
Lifetime | A fixed total the key can ever spend. The classic one-project budget: when it is gone, the key stops. |
Monthly | Resets on the calendar month. Fits recurring agents and team members with a steady allowance. |
Daily | Resets daily. The tight leash for experiments and untrusted automation. |
Requests on a capped-out key fail with HTTP 402. The account
may still have budget; this key does not. On the OpenAI-compatible
gateway:
{
"error": {
"message": "This API key's spend limit has been reached.",
"type": "rate_limit_error",
"code": "key_limit_exceeded"
}
}The Anthropic-compatible gateway returns the same condition as
an error.error.type: "rate_limit_error" payload. This is distinct
from credit_spend_limit_exceeded, which is a chat's own credit
spend limit, not a key cap.
Mint one key per agent or project, named after it, with a cap that matches its job.
Hand the agent that key only. The cap is the blast radius: a runaway loop stops at the cap, not at your account budget.
Watch per-key usage in the workspace Gateway tab; raise the cap deliberately when the work earns it.
Spend caps apply to keys that bill your idapt balance. BYOK connections are exempt: they bill the provider with your own API key and write $0 usage rows, so a USD cap on idapt's ledger has nothing to bound.
Related articles
Was this helpful?
{
"error": {
"message": "This API key's spend limit has been reached.",
"type": "rate_limit_error",
"code": "key_limit_exceeded"
}
}{
"error": {
"message": "This API key's spend limit has been reached.",
"type": "rate_limit_error",
"code": "key_limit_exceeded"
}
}