Skip to main content
idapt
HomeAI ModelsExploreResourcesPricing
Sign inUse for Free
  • Home
  • Pricing
  • AI Models
  • Skills
  • Image models
  • Voice models
  • Video models
  • Rankings
  • Multi-Model Chat
  • Agents
  • Computers
  • Drive
  • Automations
  • AI Gateway
  • All features →
  • Blog
  • About
  • Comparisons
  • Benchmarks
  • Model Match
  • Demos
  • Help center
  • FAQ
  • Privacy
  • Support
  • Developers
  • Quickstarts
  • API reference
  • API pricing
  • CLI
  • MCP
  • Migrate
  • Downloads
  • Desktop
© idapt[email protected]TermsPrivacy PolicyLegal noticeReport content
X (Twitter)Discord
Help Center
🛡️

Cap what an API key spends

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.

Three cap windows

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.

What hitting a cap looks like

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.

The agent-budget pattern

  1. Mint one key per agent or project, named after it, with a cap that matches its job.

  2. Hand the agent that key only. The cap is the blast radius: a runaway loop stops at the cap, not at your account budget.

  3. Watch per-key usage in the workspace Gateway tab; raise the cap deliberately when the work earns it.

Caps and BYOK

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.

FAQs

Related articles

🔑

API keys and scopes

Create a key, choose its scopes, pin it to an API version, rotate it, and cap what it can spend.

🚦

Rate limits and errors

Every error shape the API returns, what each rate limit is, and how to handle a wall in code.

Up next

OpenRouter-compatible API

Point OpenRouter client code at idapt: same wire shape, provider routing, model fallbacks, and key management included.

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"
  }
}