Skip to main content
Docs

One endpoint,
every model.

Tare is an OpenAI-compatible gateway in front of every model you use — ours and the ones you bring yourself. One base URL, one key, and every token accounted for.

OperationsLimits

Limits

What this solves: Tell "requests too fast" apart from "quota exhausted", learn what each of the four rate-limit tiers limits and how to adjust them, and what happens on timeout.

Rate limits and quotas are not the same thing: rate limits control request frequency, quotas control how much money you can spend or how much quota you can use. Tell them apart first when troubleshooting a failure.

Quick diagnosis

SymptomMeaningHandling
429Requests too frequentRetry per Retry-After or raise the threshold
403 + a quota/limit rejectionQuota, budget, or key limit triggeredAdjust the corresponding quota, don't blindly retry
402Account balance insufficientHandle top-up, credit, or platform model balance

Suggested setup

  1. Go live with the default rate limits first.
  2. Observe the request peak of production traffic.
  3. Raise the key or account threshold separately for high-frequency jobs.
  4. Set a cumulative limit on child keys, so no single end user runs away.
  5. Use a Mock drill for 429, quota exhausted, and arrears to confirm the client handles them correctly.

Adjust rate limits so normal peaks get through and runaway loops stop — not to push the numbers as high as possible.

Four tiers, counted independently

Rate limits have four tiers, each counted independently:

Counted byDefault thresholdGood for
Model calls (per key)100/minA runaway loop from a single end user
Model calls (account total)6000/minTen thousand keys each making a few calls: invisible at the per-key level, but the total is already maxed out
Provisioning key1200/minCreating, modifying, and disabling child keys, at roughly the frequency of billing events
Reconciliation / integration API1200/minRead-only reports; month-end reconciliation pages through hundreds of pages by day, by key, by model

Per-key model rate limits are counted independently: each end user has one child key, each with a default of 100/min; these calls are also subject to the account total default of 6000/min.

A streaming call counts as one call, regardless of duration or frame count, and the count happens at authentication time.

Four rate limits, counted apart Four rate limits are counted separately: model calls per key at 100 per minute, model calls per account at 6000 per minute, provisioning at 1200 per minute, and reconciliation at 1200 per minute. Model calls face both the per-key and the per-account caps. Four rate limits, counted apart Model calls per key: 100/min Stops one user's runaway loop Model calls, account: 6000/min Many keys, a few calls each, hide per key Provisioning key: 1200/min Create and disable child keys Reconciliation API: 1200/min Read-only. Month-end pages by day and key. Four separate counters. Model calls still face both 100/min per key and 6000/min per account. One stream is one call, counted at auth. Raise any tier yourself with PUT /v1/alerts/rules.
Four rate-limit tiers, each counted independently

Response when exceeded

Returns 429 with Retry-After (seconds).

Quota exhausted is 403, not 429: 429 means "too fast, retry later", and the client backs off and retries, whereas waiting longer won't restore an exhausted quota. See the full comparison in Error codes.

Raising the threshold

All four tiers are truly self-service via PUT /v1/alerts/rules: set a threshold and it takes effect, with no application and no waiting for approval.

TierruleTypeapiKeyId
Model calls (per key)HIGH_FREQUENCYthat key
Model calls (account total)HIGH_FREQUENCY_ACCOUNTomit it, it's account-level by nature
Provisioning keyHIGH_FREQUENCYthat provisioning key
Reconciliation / integration APIHIGH_FREQUENCYthat reconciliation key

Just include the new threshold. If you don't pass action, the platform default for this tier is used (BLOCK: reject once maxed out); set it to NOTIFY if you want notification only, without blocking.

GET /v1/alerts/rules shows the value actually in effect for each tier right now; tiers you haven't overridden show the platform default.

"In effect" is within a minute, not instant across the fleet. This change takes up to 60 seconds to roll out, during which different calls may read the old value.

Child key count

The number of child keys under an account is not limited. Ten thousand is a scale we've tested (authentication, locating by external_id, the first list page, and deep paging are all unaffected). There is no upper limit, and therefore no corresponding error code.

What is limited is the number of rows returned by a single list request: GET /v1/keys?limit= defaults to 100 and maxes out at 200; passing a larger value doesn't error; it just gets clamped to 200. Page with next_cursor (see Provisioning key).

Circuit breaker and recovery

This group is observability parameters, not an availability commitment (Tare does not provide SLA numbers).

Default
Consecutive failures before removal5
Cooldown after removalstarts at 30 seconds, exponential backoff, capped at 300 seconds
Active probingone round every 30 seconds, up to 20 per round; the first round starts 60 seconds after the service starts
Health statistics window300 seconds, minimum 5 samples, error-rate threshold 50%
Probe timeoutconnect 5 seconds / read 20 seconds

The recovery criterion is a successful probe, not waiting long enough: after the cooldown ends, active probing confirms it, and it's put back into the candidate pool once it passes. So the impact ceiling of a single upstream blip is "one cooldown period + one probe interval".

Circuit breaker state is shared, not counted separately per caller; otherwise the same failing channel would be judged repeatedly and hit the same threshold over and over.

Breaker timings, from removal back to the pool Five failures in a row remove a channel. Cooldown starts at 30 seconds, backs off exponentially, and caps at 300 seconds. An active probe runs every 30 seconds, at most 20 per round. A successful probe puts the channel back. Recovery is the probe, not the clock. Breaker timings, from removal back to the pool 1. Five failures in a row, then removed A removed channel sends no bytes. The call detail records parked. 2. Cooldown from 30s, exponential, cap 300s No requests go to this channel while it cools 3. A probe every 30s, at most 20 a round The first round starts 60s after boot 4. Probe succeeds, back in the pool Recovery is a successful probe, not the clock Breaker state is shared across instances via Redis. Otherwise each one would hit the bad channel 5 times. Health: 300s window, 5 samples, 50% errors. Probe connect 5s / read 20s. Observability, not an uptime promise.
Circuit breaker and recovery: a set of timing parameters from removal back into the candidate pool

Concurrency and timeouts

  • Concurrent connections are not limited separately; the per-minute request count above is the effective limit.
  • Connecting upstream times out at 10 seconds; failing to establish a connection counts as a failed attempt and goes to failover.
  • Read timeout is 300 seconds, and it's the cap on the gap between two frames, not the total duration of a response: a ten-minute-long answer won't be cut off, but an upstream that stalls for more than 5 minutes will be.
  • The number of upstream attempts per request is not limited by default: however many routes the model has configured, that's the maximum number of attempts. It's only truncated when the account has a limit configured separately, and a truncated candidate is recorded as never tried in the call details.

Next steps

Docs last updated Nov 27, 2026, 12:56 (UTC+8)