Rate limits
The rate is per account: 1 request a second (60 a minute) on the free trial, 5 a second (300 a minute) from the first top-up on; large volumes and companies can have it raised, and endpoints made for them. A request over the limit gets 429 at once and is not charged.
Requests a second
Per account: all its keys share it.
- It is a token bucket: it holds a minute's worth, which may go out at once, and refills evenly; it does not reset on the minute.
- What applies to an account is what the headers and
GET /v1/account(itsrate) say; the rates may be adjusted. - Calls in progress at once have a limit of their own (2 on the trial, 10 once topped up), which calls sent at the rate above seldom meet.
- The free routes with a key (
/v1/account,/v1/usage,/v1/calls/…) draw on a separate count, so looking a call up never takes from the calls you pay for. The headers on those answers speak of that count.
curl "https://onefeedapi.com/v1/account" \ -H "Authorization: Bearer $ONEFEED_API_KEY"
Common questions
- How long is the period? A minute, refilled evenly, so it can be read a second at a time: 1 a second on the free trial, 5 once topped up.
- How many calls at once? Count it as requests a second: 5 once topped up. Most calls answer within a few seconds, so at that pace only a handful run at once. For more throughput, ask for a higher rate.
- Do the limits change at any time? No. They change in two cases: the first top-up raises them by itself, and we raise them when you ask. What applies now is in the headers and in
GET /v1/account(rate). - Is a refused request charged? No. It did not run: it gets 429 at once and says how long to wait.
Not enough? A higher rate, or endpoints made for you
For large volumes and companies the rate can be raised above these, and endpoints can be made for what you need. Write to support@onefeedapi.com with the account ID (id in GET /v1/account), the endpoints, the requests a second at the peak and the calls a day. We answer within one business day.
How long and how much for 10,000 calls
- A topped-up account, an endpoint at $0.0200 a call, 10,000 calls: at 5 a second it takes about 34 minutes, and costs 10,000 × $0.0200 = $200. Failed calls are not charged.
- Send them evenly at about 5 a second, wait out
Retry-Afteron a 429, and give each call its ownIdempotency-Keyso a retry is never charged twice.
The three headers
How many requests the account may make in a minute.
How many are left now.
When the count is full again, in Unix seconds.
An answer to a request without a valid credential does not carry them.
Over the limit
A request over the limit gets 429 rate_limited at once. It did not run and is not charged. reason says which limit it was.
reasonWhat happenedHow long to waitrateToo many requests in the period.The header Retry-After, in seconds; retry_after_seconds in the body is the same number.concurrencyToo many of your calls are in progress.No time is named: wait for one of your own calls to finish.When the platform a call reads from is limiting us, the answer is 503 upstream_busy: not charged, and it carries Retry-After when a wait can be named.
Retrying
The SDKs retry by themselves: twice by default (maxRetries, in Python max_retries), only what the service says may be retried, waiting as long as it says. A wait longer than a minute is not waited out: the error is thrown with the wait on it.
Over plain HTTP, the same in a few lines:
// One key for the call and every retry of it: a retry is then never charged twice. const key = crypto.randomUUID(); async function call(url: string): Promise<unknown> { for (let attempt = 0; ; attempt += 1) { const response = await fetch(url, { headers: { Authorization: `Bearer ${process.env.ONEFEED_API_KEY}`, "Idempotency-Key": key }, }); const body = await response.json(); if (response.ok) return body; if (body.retry !== "yes" || attempt >= 2) throw new Error(body.code); // The wait the service names, or 1, 2, 4 seconds when it names none. const seconds = body.retry_after_seconds ?? 2 ** attempt; await new Promise((done) => setTimeout(done, seconds * 1000)); } }