Skip to main content

API Security: A Deep Dive into Rate Limiting

Didit limits requests per API key or IP in 60-second windows: 600 GETs a minute, 300 writes, 600 session creates. Read Retry-After on a 429, back off exponentially, and stop after about five attempts.

API Security: A Deep Dive into Rate Limiting

Contents

In this guide

Jump to the part you need.

This guide is for the team wiring Didit's verification API into production and needing throttling that holds up under a traffic spike. A full KYC check costs $0.33, the sandbox is free, and the retry path is cheap to build before you spend anything. The caveat up front: we emit X-RateLimit headers only on 429 responses, so your client learns its remaining budget at the moment it runs out.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Didit rate limiting at a glance, as documented
LayerWhat is documentedWhere it applies
Identifierx-api-key, else the first X-Forwarded-For hop, else REMOTE_ADDREvery request that is not exempt
Window60-second fixed window, one independent counter per scopeGlobal and endpoint scopes
Global capsgeneric-get 600/min, generic-write 300/min, ingest-write 600/minEvery authenticated request
Endpoint capsSession create 600/min, session decision 100/min, PDF 50/min, add-images and update-data 10/minThe named high-impact routes
429 contractX-RateLimit-Scope, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After, plus a body with detail and referenceOnly on the throttled response
Client guidanceRetry-After as the floor, then 5s, 10s, 20s, 40s with jitter, stop after about 5 attemptsYour retry handler
ExemptionsInternal console key, IsValidSession endpoints, GET /system/healthcheck, provider webhooksNever counted

Start free in the sandbox at https://business.didit.me/, no sales call needed. If you want an assistant to read the docs and write the integration, connect Didit to an AI assistant via https://didit.me/developers/mcp/.

What rate limiting does for API security

A rate limit caps how many requests one caller can make inside a window. It is the simplest control you can put in front of an expensive endpoint: the limit is checked before the work runs, while the work behind it, a document read, a liveness check or an AML screen, costs money and time. On an identity API the stakes are concrete. A retry loop with no ceiling can create sessions as fast as the network allows, and every create that finishes bills.

Three jobs rate limiting does well. It caps volume abuse such as brute force on codes or automated scraping. It protects shared capacity, so one runaway client cannot starve the rest. It also limits the blast radius of a bug: our session-create scope allows 600 requests per minute per key, which bounds how fast a mistake can spend. It does not tell you who is calling, and it does not stop a flood, which is why it sits next to authentication and fraud signals rather than replacing them.

The capability checklist for rate limiting and threat detection

Two different products get mixed together on this topic: the counter that enforces a budget, and the fraud signals that tell you whether a request deserves one. When you evaluate either, ask for these eight things in writing.

  • Counters keyed to something you control. Didit keys on x-api-key, falls back to the first X-Forwarded-For hop, then REMOTE_ADDR.
  • Published numbers, not one global cap. We document every scope and its limit, so you can size capacity before launch.
  • Stricter scopes on expensive routes. Adding images and updating data sit at 10 per minute; session creation sits at 600.
  • An exact 429 contract. Headers and body fields you can log, with a reference support can trace.
  • Documented client guidance for backoff, not a generic 429 error page.
  • An exemptions list, so internal traffic and provider webhooks are never throttled mid-callback.
  • A route to raise the caps under contract, not a support ticket and hope.
  • Signals beyond volume: device and IP analysis at $0.03 per check, 200+ fraud signals on every session, AML screening at $0.20, and transaction rules at $0.001 per transaction beyond the plan allowance.

Prerequisites

  • A Didit organization and an application. Register with a work email through the programmatic flow, or create an application and open Developers, API keys in the Business Console.
  • A sandbox key, which starts sk_test_, for the build. Live keys start sk_live_. Never put either in a browser bundle. Older keys have no prefix and keep working, so never validate a key by its prefix.
  • A workflow_id, the stable workflow UUID, from your application.
  • Any HTTP client. The examples below use curl and plain fetch, so nothing needs installing.

Step by step: make your integration rate-limit safe

  1. Find the tightest scope your traffic touches. POST /v3/session/ is counted twice: by session-v2-create at 600 per minute and by generic-write at 300 per minute, because it is a POST. Endpoint scopes apply in addition to the global scope, so for session creation the 300 per minute write ceiling is the one you will hit first.
  2. Give each workload its own key. Sharing one x-api-key across several backends collapses them into the same counter, and one noisy service starves the others. One key per workload keeps each budget independent.
  3. Get a sandbox key and create one session. The sandbox mocks external providers. Active liveness capture still runs in the sandbox, while its result is simulated. Sandbox testing is free on every plan. The call below is the documented request.
  4. Read the 429 contract before writing the handler. A throttle returns HTTP 429 with the scope, limit, remaining count, reset timestamp and Retry-After in headers, plus detail and reference in the body.
  5. Put Retry-After at the floor of your backoff. Wait at least that many seconds, then layer exponential backoff with jitter so two clients that were throttled together do not retry together.
  6. Cap the attempts and alert. Stop after a small ceiling, about five attempts, surface the error to your caller, and alert the team. Sustained 429s usually mean a runaway loop, not a transient spike.
  7. Prove the handler without burning quota. Sandbox testing is free on every plan, so stub a 429 response with the headers above and run your handler against it.
A session's liveness result in the Didit Business Console
Active liveness capture runs for real in the sandbox too. Only the result you see here is simulated.
curl -X POST https://verification.didit.me/v3/session/ \
  -H "x-api-key: $DIDIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workflow_id":"<WORKFLOW_ID>","vendor_data":"user-42","callback":"https://myapp.com/return"}'

The retry path is small enough to read in one screen. It parses the body defensively, because a 5xx response may not be JSON, it treats Retry-After as a floor rather than a suggestion, and it stops after five attempts.

async function createSession() {
  for (let attempt = 0; attempt < 5; attempt++) {
    const res = await fetch("https://verification.didit.me/v3/session/", {
      method: "POST",
      headers: {
        "x-api-key": process.env.DIDIT_API_KEY,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        workflow_id: process.env.WORKFLOW_ID,
        vendor_data: "user-42",
        callback: "https://myapp.com/return"
      })
    });

    const raw = await res.text();
    let body = {};
    try {
      body = JSON.parse(raw);
    } catch {
      // A 5xx response may not be JSON: rely on res.status.
    }

    if (res.status !== 429) {
      return { status: res.status, body };
    }

    const scope = res.headers.get("X-RateLimit-Scope");
    const retryAfter = Number(res.headers.get("Retry-After"));
    const seconds = Math.max(retryAfter, 5 * 2 ** attempt) + Math.random() * 2;
    console.log("throttled on " + scope + ", reference " + body.reference + ", wait " + seconds + "s");
    await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
  }
  throw new Error("Still throttled after 5 attempts: alert the team");
}

Expected output

On success the call returns the session, and the hosted flow redirects to your callback with verificationSessionId and status appended. On a throttle you get the documented response below, and nothing is created.

HTTP/1.1 429 Too Many Requests
Content-Type: application/json
X-RateLimit-Scope: session-v2-create
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1794358860
Retry-After: 37

{
  "detail": "Session creation rate limit exceeded. You can make up to 600 requests per minute.",
  "reference": "RL-00000000000040008000000000000001",
  "limit": 600,
  "remaining": 0,
  "reset": 1794358860,
  "window_seconds": 60
}

Two details in that payload are easy to misread. X-RateLimit-Reset is the Unix second when the counter resets, so the wait is reset - now. window_seconds is the length of the window, not the time left in it. Use Retry-After for the delay, since it is rounded up so that waiting it always lands in the next window.

Inputs and outputs

What goes into the call and what comes back
TypeFieldWhat it controls
Inputx-api-key headerSelects the rate-limit counter. Key-scoped when present.
InputX-Forwarded-For headerFirst hop becomes the identifier when no key is sent.
Inputworkflow_idNo effect on the limit. Decides whether the session is KYC or KYB.
Inputvendor_dataNo effect on the limit. Binds the session to your user for duplicate detection.
InputcallbackNo effect on the limit. Must sit on an allowed domain when the application sets one.
OutputCreated sessionThe verification the user completes. The redirect carries verificationSessionId and status.
OutputX-RateLimit headersScope, limit, remaining and reset. Present only on a 429.
OutputRetry-AfterSeconds to wait before the next attempt. Present only on a 429.
Outputdetail, reference, limit, remaining, reset, window_secondsHuman message plus a support reference. Do not parse reference for business logic.

Failure cases and recovery

What each failure means and what to do next
StatusWhat it meansRecovery
429, scope session-v2-createThe session-create budget is spent for this key.Wait Retry-After, then back off with jitter. If it repeats, check for a loop.
429, scope generic-writeAll POST, PATCH and DELETE traffic on this key exceeded 300 per minute.Lower write concurrency or split workloads across keys.
429 on more than five consecutive attemptsNot a spike. Usually a runaway loop or a shared key.Stop retrying, alert, and inspect the caller. Do not raise the cap to hide it.
401Key wrong, malformed, revoked or expired.Log back in through the programmatic login flow and fetch the key again.
403, no key or no accessMissing header, a scoped key without access to this endpoint, or a call from outside the key's IP list.Use a key with that access from the console.
403 with application_deletedThe key's application was deleted.Do not retry. The application and its keys no longer exist.
400 on session createValidation failure, or the credit balance cannot cover the call.Read detail, fix the field or top up.
409Conflicts with current state, such as a reused Idempotency-Key or a step that already ran.Read the code and reload the state.
500, 502, 503An error on our side or a dependency that is unavailable.Retry with backoff. A 500 may have no JSON body, so rely on the status.
A session overview with its warnings in the Didit Business Console
A throttled request never reaches this screen. When a session does land, its warnings and decision are what you review.

The limits you are planning against

Global scopes bucket every authenticated request by HTTP method, so a new route inherits a default budget.

Global scopes
ScopeHTTP methodsLimitWindow
generic-getGET600 / min60 s
generic-writePOST, PATCH, DELETE300 / min60 s
ingest-writePOST /v3/transactions/, POST /v3/events/, POST /v3/events/batch/600 / min60 s

Transaction creates and event ingestion count against ingest-write instead of generic-write, so a high-volume ingestion pipeline gets 600 per minute per key without spending the budget of your other writes.

Endpoint scopes
ScopeEndpointsLimit
session-v2-createPOST /v2/session/, POST /v3/session/600 / min
session-decisionGET /v1/session/<id>/decision/, GET /v2/session/<id>/decision/100 / min
session-generate-pdfGET /v1/session/<id>/generate-pdf/, GET /v3/session/<id>/generate-pdf/50 / min
session-add-imagesPOST and PATCH /session/<id>/add-images/10 / min
session-update-kycPOST and PATCH /session/<id>/update-data/10 / min
session-update-poaPOST and PATCH /session/<id>/update-poa-data/10 / min

Three corrections matter more than the tables. GET /v3/session/<id>/decision/ is served by a different view and is not in the session-decision scope, so it answers to the 600 per minute generic-get ceiling; the 100 per minute decision throttle covers the v1 and v2 paths. The constants FREE_SESSION_RATE_LIMIT and PAID_SESSION_RATE_LIMIT exist in the codebase but are not applied to POST /v3/session/, which uses one 600 per minute limit for every application, so do not plan capacity around a per-workflow free-tier throttle. On Enterprise, the global limits and the session-v2-create, session-decision and session-generate-pdf limits can be raised on request.

Rate limiting and DDoS protection

These solve different halves of one problem, and buyers often collapse them into a single line item. A rate limit is a budget per caller inside the application: it stops one key from spending the whole capacity of an endpoint. DDoS protection is filtering and capacity in front of the network: it stops a flood of traffic from reaching the server at all.

What our documented controls do is per-key or per-IP counters with 60-second windows, stricter scopes on the expensive routes, and a 429 contract that tells a well-behaved client exactly how long to wait. What they do not do is absorb a volumetric flood. If your own endpoints face the public internet, put that filtering at your edge and keep separate limits for your own users.

Two details help during an incident. Counters are isolated per identifier, so one key's traffic does not spend another key's budget. And GET /system/healthcheck bypasses the limiter, so monitoring keeps answering while a key is throttled. Provider webhooks are exempt as well, which is why a Stripe, AML screening or face verification callback is not refused because your own polling loop used up a budget.

Where counters end and threat detection starts

A counter answers one question: has this caller sent too much. It cannot tell you whether the requests are honest. That is a separate decision, and it is the part of an identity and fraud setup that costs money. Device and IP analysis costs $0.03 per check and flags the network behind a session. Every session carries 200+ fraud signals. AML screening costs $0.20 per check against 1,300+ lists. Transaction Monitoring rules run at $0.001 per transaction beyond the plan allowance, priced on the Didit pricing page.

In practice you combine them the other way round from how vendors describe it. The counter protects the API, the signals score the request, and a person reviews only what survives both. Rate limiting that silently drops suspicious traffic without a record is a blind spot, not a control.

One transaction monitoring rule in the Didit Business Console
A rule decides what happens to a transaction. The rate limit decides how many transactions can reach the rule.

Worked cost example

Take an organization running 40,000 full KYC checks, 40,000 AML screens and 5,000 wallet screenings a month, and pushing 200,000 transactions into Transaction Monitoring on the Scale plan, whose allowance is 100,000 monitored transactions a month. All figures are published unit prices.

  • Full KYC: 40,000 x $0.33 = $13,200
  • AML screening: 40,000 x $0.20 = $8,000
  • Wallet screening: 5,000 x $0.15 = $750
  • Transaction monitoring overage: (200,000 - 100,000) x $0.001 = $100
  • List total: 13,200 + 8,000 + 750 + 100 = $22,050

On Scale every Didit price is 10% lower: 13,200 x 0.9 = $11,880, 8,000 x 0.9 = $7,200, and 750 x 0.9 = $675. The $0.001 transaction price is the same on every plan, so that line stays at $100. Total: 11,880 + 7,200 + 675 + 100 = $19,855 of usage. The plan's $350 of monthly credit covers the first $350 and top-ups cover the remaining $19,505, on top of the $299 monthly plan fee. Compare plans on the pricing page.

How Didit Billing Works: Credits, Auto-Recharge and Volume Discounts
Credit, top-ups and the plan discount, which is what the arithmetic above uses.

Rate limiting does not change those unit prices, but it changes how fast a bug can spend them. A loop that pushes 10,000 duplicate creates is stopped at 600 per minute per key, which bounds the damage without removing it: creates that finish still bill. A throttled call does not, because we bill per completed check.

The sandbox is free on every plan. The Workflow Orchestrator, the SDKs, Reusable KYC and the MCP server are free. Everything that produces a decision is priced per completed check: $0.33 for a full KYC check, itemized as $0.15 for the ID document, $0.10 for passive liveness, $0.05 for face match and $0.03 for device and IP analysis. A throttled request is refused by the middleware before the endpoint runs, so it produces no billable check and no session to clean up.

Human review sits outside the throttling path. Our rate limiting is automatic and needs nobody watching it. A session that lands in review, or an AML hit that needs a decision, goes to the Business Console, where a person on your team resolves it. Raising a rate limit is a contract conversation on Enterprise, not a self-serve toggle, which is the boundary worth knowing before launch.

Developers who want an assistant to read these docs and scaffold the handler can connect Didit through the Didit MCP server, which is free on every plan.

Sources

The next step is a sandbox key, not a contract: create an application at https://business.didit.me/, run the session create call above, and keep the retry handler in the code path before you swap in a live key. No sales call is involved.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

What are Didit's API rate limits?

Limits apply per identifier, which is your x-api-key, or your client IP when no key is sent, with a 60-second fixed window and one counter per scope. Globally that means 600 GET requests per minute, 300 POST, PATCH and DELETE requests per minute, and 600 per minute for transaction and event ingestion. Endpoint scopes add stricter caps on top: 600 per minute for session creation, 100 per minute for v1 and v2 session decisions, 50 per minute for PDF generation, and 10 per minute for add-images or update-data calls.

What does a 429 response from Didit look like?

It is HTTP 429 with headers X-RateLimit-Scope, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and Retry-After, plus a JSON body carrying detail, reference, limit, remaining, reset and window_seconds. The reference starts with RL- and is there for support, so save it when you report a throttle.

Does Didit send rate limit headers on successful requests?

No. The X-RateLimit headers are emitted only on the 429 response, so successful calls tell you nothing about the remaining budget. Plan capacity from the published limits, and treat the headers as the signal that a budget just ran out. The same applies to Retry-After, which appears only on throttled responses.

How long should my client wait after a 429?

Use Retry-After as the floor, because it is rounded up so that waiting it always lands in the next window. Layer exponential backoff with jitter on top, roughly 5s, then 10s, 20s and 40s with a random component so two clients throttled at the same moment do not retry in lockstep. Stop after about five attempts and alert your team.

Can I raise Didit's rate limits?

On the Enterprise plan, the global limits and the session-v2-create, session-decision and session-generate-pdf limits can be raised on request. Self-serve plans run on the published numbers. Raising a cap is a contract change, so ask before your launch date rather than during an incident.

Which Didit endpoints bypass rate limiting?

The internal console key, endpoints protected by the IsValidSession permission that carry embedded and SDK session traffic, GET /system/healthcheck, and provider webhooks such as Stripe, AML screening, face verification callbacks and KYC list mutations. Those calls never consume a budget, which is why health monitoring and provider callbacks keep working during a throttle.

Is rate limiting the same as DDoS protection?

No. Rate limiting is a per-caller budget inside the application that stops one key or IP from consuming shared capacity. DDoS protection is filtering and capacity in front of the network that stops a volumetric flood reaching the server. You want counters at the API layer and filtering at your edge, and our counters keep each identifier's budget separate rather than promising capacity across shared infrastructure.

Am I billed for a request that gets a 429?

No. A 429 comes from the rate-limit middleware before the endpoint runs, and billing is per completed check. A throttled request creates no session and produces no billable check, so the only cost of a retry is the request itself. This is why a runaway loop is a capacity problem first and a billing problem second.

What are the rate limits in the sandbox?

The docs do not publish separate sandbox rate limits. Sandbox testing is free on every plan, and sandbox sessions are never billed. External providers are mocked, except that active liveness capture runs for real while its result is simulated. Test your 429 handler against a stubbed 429 response rather than by firing real calls at the cap.

Why does a v3 session decision call not hit the 100 per minute limit?

GET /v3/session/<id>/decision/ is served by a different view and is not in the session-decision scope, so it is governed only by the 600 per minute generic-get ceiling. The 100 per minute decision throttle applies to the v1 and v2 decision paths. Size polling against the scope you actually call.

Do free and paid workflows get different session create limits?

No. The codebase defines FREE_SESSION_RATE_LIMIT at 10 and PAID_SESSION_RATE_LIMIT at 600, but those constants are not applied to POST /v3/session/, which uses the single 600 per minute session-v2-create limit for every application. Do not plan capacity around a per-workflow free-tier throttle until it is documented as live.

How many requests per minute can one API key make in total?

Counters are per scope, not one shared pool, so a key can spend 600 GET requests per minute and 300 write requests per minute independently. Transaction and event ingestion counts against ingest-write at 600 per minute instead of the write ceiling. A single request can touch two scopes, and the first scope to run out is the one that returns the 429.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.