BroadRouter
Get started

Spend limit

Updated

A spend limit is a cap on how much an API account, project or key may spend in a period, usually a month. When usage reaches it, the provider rejects further requests, often with an HTTP 429 or 400 error, until the period resets or the limit is raised.

Also called: spending limit, spend cap, budget cap, usage cap

A rate limit controls how fast you can spend. A spend limit controls how much.

How it works

Providers layer several caps. Two documented examples:

Provider Control What happens when reached
Anthropic Tier spend cap per calendar month (Start, Build, Scale; Custom has none) Usage pauses until 00:00 UTC on the first of next month; HTTP 429 rate_limit_error with error.details.error_code enforced_spend_limit_reached, no retry-after
Anthropic Your own lower limit, organisation or workspace HTTP 400 invalid_request_error, message starting “You have reached your specified API usage limits”
OpenAI Monthly usage limit per tier Not described in the guide
OpenAI Spend alert Sends a notification; traffic continues
OpenAI Hard spend limit, organisation or project Affected requests return 429

Anthropic’s tier caps are USD 500 (Start), USD 1,000 (Build) and USD 200,000 (Scale) a month. OpenAI’s guide lists monthly usage limits by tier, from USD 100 on Free to USD 200,000 on Grow, and says tiers rise as total credit purchases cross thresholds.

The tricky part is that a spend-limit 429 looks like a rate-limit 429. On Anthropic’s API the error code tells them apart, and the spend-cap response has no retry-after header:

err = resp.json().get("error", {})
if resp.status_code == 429 and err.get("details", {}).get("error_code") == "enforced_spend_limit_reached":
    stop_job_and_alert()      # retrying will not help
elif resp.status_code == 429:
    backoff_and_retry()

Why it matters

  • Alerts are late. A fast loop can spend a lot before an email arrives. A hard cap stops it.
  • Retries make it worse. A client that backs off and retries every 429 will hammer a spend cap uselessly. Tell the two apart.
  • Shared caps. An account-level cap shared by many apps lets one runaway job block the others. Per-project budgets or your own in-code budget keep them separate.

On BroadNet Inference

BroadNet’s API reference lists six limits on a pay-as-you-go key. The three that bound cost and throughput are 30 requests per minute, 4 in flight, and spend, defined as “the native budget shared by the account’s pay-as-you-go keys”; the others are the allowed models, a one-year key lifetime and up to ten live keys per account. The account is prepaid, so the balance is the outer cap. Two status codes matter:

  • 429: “A rate, concurrency, token-rate or spending limit was reached.”
  • 401: a missing, invalid or expired key, or an account whose shared pay-as-you-go budget is blocked (the docs’ wording is “a blocked native PAYG budget holder”), “including exhausted PAYG allowance”.

BroadNet’s privacy page says keys are scoped by model, rate and spend, but the API reference shows no per-key or per-project budget setting, so put a running budget check in your own code before each request, as in LLM API spend control. For a fixed worst case, a flat-rate plan or an hourly key at $0.50 caps spend by design. Retry handling is in the errors and retries guide.

Questions

Should I retry a request that hit a spend limit?

No. Anthropic says its spend-cap 429 carries no retry-after header and retries fail until access resumes. Alert a human or stop the job.

Is a spend alert the same as a spend limit?

No. OpenAI distinguishes a spend alert, which only notifies and lets traffic continue, from a hard spend limit, which makes requests return 429.

Can I set a separate budget per BroadNet key?

BroadNet's privacy page says scoped API keys control access by model, rate and spend, but its API reference documents spend on a pay-as-you-go key as the native budget shared by the account's keys and shows no per-key budget setting. Check your key details, and enforce per-app budgets in your own code.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity