Skip to main content
Hostlinku enforces usage limits across three complementary layers: rate limit (number of requests per time period), credit limit per API key (cost per reset window), and account balance (funding source). All three are checked on the server side before a request is forwarded to the provider.

Rate Limit

Every response that passes through the limiter includes standard headers (IETF RateLimit-* format): RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset. Check the Reset value to determine when the next window begins. When the limit is exceeded, the response is:

Credit Limit per API Key

In addition to the rate limit, each API key can be assigned a cost limit (USD) with a daily, weekly, or monthly reset window (UTC calendar), or a total limit with no reset. Usage is calculated based on the actual cost of requests per API key. API keys that reach the limit will be rejected with a 402 PAYMENT_REQUIRED error until the next window begins. Configuration details can be found in Authentication.

Reserve the balance when making a request

For each request, the gateway:
  1. Reserve the estimated cost (based on the prompt length and max_tokens) from the account balance.
  2. Forward the request to the provider.
  3. Commit the actual cost based on the tokens used, and release the remaining reservation.
This means: the balance in the console is divided into balance (total) and reserved (held for ongoing requests). The amount available for new requests is balance − reserved (available). Failed requests are not charged; their reservations are automatically released.

Monitoring usage in the console

Go to console.hostlinku.com: All figures come from the same backend telemetry table used for billing, with no estimates on the front end.

Summary of Behaviors 429 and 402