Dashboard

Rate Limits

Configure requests per minute (RPM) and tokens per minute (TPM) separately for each API key from your BLACKBOX AI dashboard.

Configure rate limits for an API key

  1. Open https://app.blackbox.ai/dashboard.
  2. Click the three dots for the API key you want to control rate limits for.
  3. Click Edit in the three dots dropdown.
  4. In the popup, enter the RPM and TPM values you want to set for this specific key.
  5. Click Update Key to save those changes.

RPM limits how many API requests the key can make per minute. TPM limits how many tokens the key can process per minute.

Remaining Azure TPM in response headers

Set include_remaining_tpm to the JSON boolean true in your inference request to receive the Azure-compatible header x-ratelimit-remaining-tokens. It reports the combined remaining Azure token capacity for the requested model across its configured regions.

With this flag enabled, the gateway sums fresh observations from Azure's rate-limit response headers. It includes the serving region's latest value when that observation arrives before your response headers are sent. The total covers the model's Azure pool, including when a provider fallback or /v1/messages serves the request through another provider.

The headers are supported on /v1/chat/completions (also /chat/completions), /v1/responses, and /v1/messages, for both JSON and streaming responses.

x-ratelimit-remaining-tokens: 297000
x-ratelimit-limit-tokens: 300000

In this example, two Azure regions for the requested model report a combined 297,000 tokens remaining out of their combined 300,000-token limit.

Header Meaning
x-ratelimit-remaining-tokens The sum of fresh remaining-token observations for the requested model's Azure regions.
x-ratelimit-limit-tokens The sum of token limits for those observed regions, returned only when every observed region provides a valid limit.

Only regions configured to serve the requested model contribute. Duplicate configuration entries for the same Azure resource and model deployment are counted once. Session affinity or encrypted-history restrictions on a particular request do not narrow this model-wide total. For model: "auto", the headers describe the model selected by the router.

Enable and read the headers

Add this top-level field to the JSON request body:

{
  "include_remaining_tpm": true
}

Omitting the flag or setting it to false skips the aggregate-capacity Redis lookup and returns no token-capacity headers. The strings "true" and "false" do not enable this option. The gateway consumes the flag before sending the request to a provider.

Opted-in requests wait for one Redis capacity read before inference starts when Redis is configured. That lookup adds time to TTFT and total completion time; Redis operations use a default timeout of one second per operation. Requests without the flag avoid this additional lookup.

Use curl -i to include response headers:

curl -i https://enterprise.blackbox.ai/v1/chat/completions \
  -H "Authorization: Bearer $BLACKBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5.4","messages":[{"role":"user","content":"Hello"}],"include_remaining_tpm":true}'

With JavaScript, read the headers before consuming the response body or stream:

const response = await fetch("https://enterprise.blackbox.ai/v1/responses", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ model: "gpt-5.4", input: "Hello", stream: true, include_remaining_tpm: true }),
});

const remainingHeader = response.headers.get("x-ratelimit-remaining-tokens");
const remainingAzureTpm = remainingHeader === null ? null : Number(remainingHeader);

For streaming requests, the snapshot is sent with the initial HTTP headers and stays the same throughout the stream. If a keepalive sends headers before Azure responds, the snapshot uses the observations available at that earlier point. These headers are included in Access-Control-Expose-Headers for browser clients when cross-origin access is permitted.

Freshness and incomplete coverage

This is a capacity estimate based on observed Azure responses. Observations are shared across gateway workers through Redis when configured; a worker can use its local observations when Redis is unavailable. Observations older than 90 seconds are excluded by default.

Some configured regions may have no fresh observation. Their capacity is unknown and is excluded from the sum, so the remaining-token header can describe only part of the model's Azure pool. The gateway does not issue extra inference calls to probe idle regions.

The token headers are omitted when no fresh observation exists, or when the requested model has no configured Azure pool. Treat a missing header as unknown capacity. Azure regions that return HTTP 429 contribute zero available capacity even if Azure's token header still reports a positive value, because Azure can also throttle requests or concurrency.

Azure updates its rate-limit counters as requests run, and other clients can consume capacity after the snapshot. A positive total does not guarantee that the next request will succeed, especially when it must stay on a particular region. API-key RPM and TPM limits configured in your dashboard remain separate from this Azure capacity estimate.