Skip to Content

Rate Limits

Rate limits cap how many requests and tokens an API key can use over a period of time. They protect the service from overload, keep capacity fair across users, and give every account predictable performance. When you go over a limit, the gateway rejects the request instead of queuing it indefinitely.

Base URL for all requests:

https://gateway.mytokengate.com/v1

Limit dimensions

Limits are applied across several dimensions. Not all of them apply to every account, and the actual numbers depend on your account tier. Check your dashboard for the values that apply to you.

DimensionMeaning
RPMRequests per minute
RPDRequests per day
TPMTokens per minute
TPDTokens per day
IPMImages per minute
IPDImages per day

Default limit

The default limit is 100 requests per minute. Higher account tiers and dedicated instances have different limits, and some are configured with no per-minute cap at all. If you are unsure which tier you are on, check your dashboard.

Response headers

Every response includes headers describing your current rate-limit state, so you can track usage without waiting for a rejection.

HeaderMeaning
X-RateLimit-LimitThe maximum number of requests allowed in the current window
X-RateLimit-RemainingThe number of requests still available in the current window
X-RateLimit-ResetThe time the window resets, as a Unix epoch timestamp in seconds

Example:

X-RateLimit-Limit: 100 X-RateLimit-Remaining: 87 X-RateLimit-Reset: 1735689600 # Unix epoch seconds

Handling 429

When you exceed a limit, the gateway returns HTTP 429. The right way to recover is to retry with exponential backoff and jitter: wait a little longer after each failure, and add a small random offset so many clients do not retry at the same instant.

import random import time from openai import OpenAI client = OpenAI( base_url="https://gateway.mytokengate.com/v1", api_key="tg-your-api-key", ) def create_with_retry(max_retries=5): for attempt in range(max_retries): try: return client.chat.completions.create( model="gpt-5.6-sol", messages=[{"role": "user", "content": "Hello"}], ) except Exception: if attempt == max_retries - 1: raise delay = 2 ** attempt + random.uniform(0, 1) time.sleep(delay) response = create_with_retry() print(response.choices[0].message.content)

Dedicated instances

Dedicated-instance users typically have no rate limits. If you receive a 429 on a dedicated instance, it is usually not a limit issue. Verify that the model name in your request is correct and that the API key you are using belongs to that instance.


For the full list of error responses, see Error Codes.

Last updated on