Skip to content

Rate limits

The gateway limits how many requests per minute your organization can make to each model. Fourier Health sets the limit for each model your organization can call; see Rate limits in the console. Every response that reaches the rate limit check tells you your limit and how much of it is left.

  • Per model. Each model has its own limit and its own window. Requests to one model never count against another.
  • Sliding window. The gateway counts your requests over the last 60 seconds. There is no reset at the top of each minute.
  • Rejected requests don’t count. A 429 doesn’t consume any of the window, so a retry after retry-after seconds isn’t penalized.

The gateway reports the limit in the following headers:

Header Value
x-ratelimit-limit Your requests-per-minute limit for the requested model.
x-ratelimit-remaining Requests you can still make in the current window after this one. 0 on a 429.
x-ratelimit-reset Seconds until the oldest request in the window drops out of it and frees capacity, from 1 to 60.
retry-after Only on 429: seconds to wait before retrying. Equal to x-ratelimit-reset.

The headers appear on every response that reached the rate limit check. Responses rejected earlier, such as 401 or 403, don’t carry them.

To read the headers through the openai SDKs, use client.embeddings.with_raw_response.create(...) in Python and client.embeddings.create(...).withResponse() in TypeScript.

When you exceed the limit, the gateway returns 429 with a problem body and the rate limit headers:

429 Too Many Requests
HTTP/1.1 429 Too Many Requests
Content-Type: application/problem+json; charset=utf-8
x-ratelimit-limit: 300
x-ratelimit-remaining: 0
x-ratelimit-reset: 12
retry-after: 12
x-request-id: 5c8e0d9c-2a4f-4b0e-9e1b-3f6a7d8c9e01
{
"type": "about:blank",
"title": "Too Many Requests",
"status": 429,
"code": "rate_limited",
"detail": "Rate limit exceeded"
}

The official openai SDKs retry 429 responses automatically, along with connection errors and 5xx responses, twice by default with exponential backoff. Raise the retry count for batch jobs, or set it to 0 if you handle retries yourself:

import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["FOURIER_API_KEY"],
base_url="https://gateway.fourierhealth.com/v1",
max_retries=5,
)
# Or per request:
client.with_options(max_retries=5).embeddings.create(
model="ClinEmbed-1",
input="Allergies: penicillin (rash).",
extra_body={"input_type": "document"},
)

If you call the API directly, wait retry-after seconds before you retry, and add a little jitter so parallel workers don’t retry at the same moment.

To stay within the limit in the first place, batch up to 1,000 strings into one input array. The limit counts requests, not strings or tokens.