ExportFlowDevelopers
Sign inGet API keys

Building reliably

Rate limits and quotas

Three different things can answer 429: too many requests in a minute, too many documents waiting to be processed, and a monthly allowance used up. They are handled differently.

Rate limits#

Requests are counted in one-minute windows, aligned to the clock, at three levels at once:

The three rate-limit counters
CounterIts limit
The organisationThe limit on your account if MeerTech has set one, otherwise the limit in your plan, otherwise the default of 120 requests a minute.
The applicationThe application's own limit if one is set in the console; otherwise the organisation's.
The keyThe key's own limit if one was set when it was issued; otherwise the organisation's.

A request is refused when any of the three is over its limit. An application or a key can be given a lower limit than the organisation, so that one noisy integration cannot use up everybody else’s allowance; neither can be given more than the organisation has. Every authenticated request counts, including ones that are then refused.

The limit your plan sets is shown in the console under Billing.

The RateLimit headers#

Every response from an authenticated request says where you stand:

Response headers
RateLimit-Limit: 120
RateLimit-Remaining: 117
RateLimit-Reset: 42
Rate-limit headers
HeaderMeaning
RateLimit-LimitThe tightest limit that applies to this request, in requests a minute.
RateLimit-RemainingRequests left in the current window.
RateLimit-ResetSeconds until the window ends and the count starts again.

The figures above are an example of the format. Read the headers rather than assuming a limit: yours may differ from the default.

When you are rate limited#

A request over the limit is answered 429 with the code rate_limited and a Retry-After header giving the number of seconds to wait.

429
HTTP/1.1 429 Too Many Requests
Retry-After: 42
RateLimit-Limit: 120
RateLimit-Remaining: 0
RateLimit-Reset: 42

{"error": {"code": "rate_limited", "message": "Too many requests. Slow down and retry after the time given in Retry-After."}}

Wait for Retry-After, then send the request again with the same Idempotency-Key. The SDKs do this automatically, up to their retry limit. If you run many workers, slow all of them down when one is limited: the counters are shared.

Documents in progress#

An account can have at most 40 documents waiting to be processed at once. A further upload is answered 429 with the code too_many_documents_in_progress, and the message says how many are waiting. This is what stops one bulk load filling the queue everybody shares.

It is not a rate limit, and there is no Retry-After: upload again when some documents have finished, with a new Idempotency-Key, because the refusal is remembered against the key it answered. For a bulk load, upload in batches and let document.processing.completed events, or polling, tell you when there is room.

Monthly quotas#

A plan can include an allowance for each kind of work in a period: documents uploaded, documents processed, verifications. What happens when an allowance is used up depends on the plan. Either further work is charged at the plan’s rates, or it is refused until the next period:

Quota refusals
CodeMeaning
quota_exceededThe allowance for this kind of work is used up for the period. The message gives the allowance and the date it resets.
spend_limit_reachedThe account has reached its spending limit for the period.

Both are answered 429, and neither goes away by waiting a few seconds, so the SDKs do not retry them: they raise a quota error straight away. A quota is checked when work is requested, on an upload and on starting a verification; reading results is never refused for quota.

Your allowances, and how much of each you have used this period, are in the console overview and in GET /usage, where each meter has a quota (null when there is no limit). If you subscribe to it, the usage.threshold.reached webhook tells you when an allowance reaches 80% and 100%.

Sandbox quotas#

The sandbox has its own allowances, separate from production and defined by your plan. They exist to keep a test loop from running away, not to charge you: sandbox usage is measured and never charged, and using the sandbox never uses up a production allowance. When a sandbox allowance is used up, further work in the sandbox is refused with quota_exceeded until the next period; it is never charged instead. The sandbox allowances on your plan are listed in the console under Billing.

Rate limits are shared between environments

The per-minute counters are for the organisation, the application and the key, whichever environment the key belongs to. A load test in the sandbox counts towards the same per-minute limit as production traffic from the same organisation.

See Billing for what is charged.