CrabGlamp

Raise a spend cap

Increase or decrease the maximum spend a virtual key can accrue. This guide covers the minimum cap floor, how the proxy enforces the cap, when a raise takes effect, and what happens when the cap is reached (HTTP 429 until the cap is raised or the billing period rolls over).

Last updated:

You hit your spend cap or want to bump it preemptively. The cap is per-key and applies to the combined LLM and voice spend.

Minimum cap

The minimum spend cap is 2000 cents ($20). Below the floor, the PATCH /api/provider-keys/[id] endpoint returns a 400 validation error. The minimum protects against accidental zero-cap keys that would block every request. Pass null to remove the cap entirely.

From the dashboard

  1. Open /dashboard/llm.
  2. Click the key card you want to update.
  3. Click Edit cap.
  4. Enter the new value in cents (the dashboard renders dollars but submits cents).
  5. Click Save.

The dashboard issues PATCH /api/provider-keys/[id] with body { "spendLimitCents": 20000 } for a $200 cap. Same endpoint accepts { "spendLimitCents": null } to remove the cap. (The cap is set from the dashboard or this API — there is no crabglamp keys CLI command for it.)

When the change takes effect

  • The new cap is saved immediately.
  • The proxy picks it up and enforces it on every request within about two minutes.

What happens when the cap is reached

The proxy returns HTTP 429 with body { "error": "Monthly spend limit reached", "limit": <cents>, "current": <cents> }. Subsequent requests with the same key also return 429. The dashboard card flips to a red banner indicating the cap is reached.

Accrued spend resets each invoice period. The cap itself does not reset; it stays the value you set until you change it again.

Related

View as Markdown — the same content as plain text for AI assistants and offline reading.

Was this helpful?