Set an Age Estimation Buffer and Route Uncertain Results to ID Checks
Set the decline threshold to the bottom of your buffer, read the predicted age float, and route the band around your legal age to ID verification. Didit Age Estimation is $0.10 per check.

Contents
In this guide
Jump to the part you need.
This guide is for teams that gate an age-restricted product with a selfie instead of a document, and want the borderline cases handled properly. The method sets a buffer around your legal age and sends that band to ID verification. Didit Age Estimation costs $0.10 per check. The caveat up front: the age is model-predicted from a face, not verified against a document, so the buffer marks where the estimate stops being enough.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Zone | Predicted age | What the call returns | Your route |
|---|---|---|---|
| Clear minor | Under 16 | Declined with AGE_BELOW_MINIMUM | Reject on the selfie, no document needed |
| Buffer band | 16 to under 20 | No age warning fires, your code reads the float | ID verification, then decide on the document |
| Clear adult | 20 and over | Approved, empty warnings | Approve on the selfie |
Start free in the sandbox at business.didit.me; there is no sales call and sandbox calls are not billed. Developers who want an assistant to wire this up can connect Didit to an AI assistant through the Didit MCP server. The step is documented at the Age Estimation overview, and every unit price is on the pricing page.
The outcome you are building
An age gate built on a selfie usually has one cut: predicted age above 18, let them in; below, turn them away. That single cut is wrong in both directions near the line. A 17-year-old who reads at 18.4 walks into an 18+ product. An 18-year-old who reads at 17.6 is turned away and has to appeal. That reading should route to a document check instead of a rejection.
A buffer adds a third zone. Clear minors are rejected on the selfie alone. Clear adults are approved on the selfie alone. The band between them goes to ID verification, where a document and a face match decide. You keep the cheap selfie path for most traffic and spend the document check only where the estimate cannot carry the decision.

Recommended method: set the threshold at the bottom of the band
The standalone POST /v3/age-estimation/ call takes age_estimation_decline_threshold, default 18. The easy mistake is to leave that at 18 and treat the returned status as the whole decision. The status is a two-way answer, so the band disappears and the decline bucket doubles as your buffer, at a width you did not choose.
Set the threshold to the bottom of your buffer instead. For an 18+ product with a two-year buffer, that is 16. The call then declines only the selfies it places under 16, and everything from 16 upward comes back without an age warning. Your code reads the predicted age float and picks the zone. The threshold stays a safety net for obvious minors; it is not the decision.
The 18+ gate, the two-year width and the 16 to 20 band are an example you can copy, not a platform setting. The legal minimum comes from the markets you sell in, and the buffer width is your own policy decision. The API enforces only the decline threshold you pass; the band above it is routing logic you own.
In this article we use a two-year buffer as an example policy, because the published error is concentrated there. That width is our own example, not a Didit recommendation. Didit's Age Estimation documentation states it directly:
Its mean absolute error is 1.1 years for 16 and 17-year-olds and 1.9 years for 18 to 20-year-olds, and it correctly classifies 96% of selfies as under 18 or 18 and over.
The same page adds the operating rule: borderline ages near your threshold deserve a fallback to document-based verification, because the error grows for faces close to the limit. A two-year band is a practical policy choice for handling estimates near the threshold.
If you cannot add routing code yet, keep the default 18 and treat Declined plus AGE_BELOW_MINIMUM as "send to ID verification" rather than "reject". That works, but read the warnings array first. A decline for LOW_LIVENESS_SCORE or LIVENESS_FACE_ATTACK is a spoof signal, not an age signal, and must not be pushed into a document fallback. If you are rebuilding an existing flow, the switch guide covers what changes.
Prerequisites
- A Didit account and an application API key, sent in the
x-api-keyheader. - Credit on the organization. Each 200 response on the age endpoint consumes one Age Estimation check at $0.10. When the balance cannot cover the call, the endpoint returns 403 before any image processing.
- For the standalone route, a selfie as jpg, jpeg, png, tiff or webp, maximum 5 MB. PDFs are not accepted.
- For the session route, a workflow whose Liveness node has age estimation enabled, with
age_estimation_decline_thresholdset on that node. - An ID Verification step in the same workflow, or a second workflow you can start when the band is hit.
- The fallback workflow must include a Face Match step if you plan to read
face_matches[]. Without that step the array is absent from the decision, and you have no document-to-selfie comparison to decide on.
Step-by-step
Fix two numbers. The legal minimum for your market, 18 here, and the buffer width in years, 2 here. Write them as constants. Every later step reads them, so you change them in one place when you enter a market with a different age.
Set the decline threshold to the bottom of the band. 18 minus 2 is 16. Pass
age_estimation_decline_threshold=16. Keepsave_api_request=trueso the call is stored as an API-type session, itsrequest_idbecomes a real session id, and the result is readable later atliveness_checks[]withfeatures: ["AGE_ESTIMATION"].Make the call. Server to server, with a selfie already captured. The documented request:
curl -X POST 'https://verification.didit.me/v3/age-estimation/' \ -H 'x-api-key: YOUR_API_KEY' \ -F 'user_image=@./selfie.jpg' \ -F 'age_estimation_decline_threshold=16' \ -F 'save_api_request=true' \ -F 'vendor_data=user-1234'In a hosted flow, enable age estimation on the Liveness node in the workflow and skip to step 5. There is no separate age estimation workflow feature; it runs inside the Liveness step and the result lands at
liveness_checks[].age_estimation.
Simple mode and advanced mode in the Didit workflow builder. Age estimation is enabled on the Liveness node, not as a separate workflow feature.
Passive liveness runs in the same call and can flag presentation attacks such as photos, screens, or masks.
Read the predicted age, not just the status. The float at
age_estimation.age_estimationdrives the routing. Check the warnings first, then the float. The minimum glue, using the documented response fields:// response = parsed body of POST /v3/age-estimation/ const AGE_MIN = 18; // your legal minimum const BUFFER_YEARS = 2; // your policy choice const DECLINE_THRESHOLD = AGE_MIN - BUFFER_YEARS; // 16, sent as the threshold const BAND_TOP = AGE_MIN + BUFFER_YEARS; // 20 const result = response.age_estimation; const warnings = result.warnings || []; if (warnings.includes("AGE_NOT_DETECTED") || warnings.includes("NO_FACE_DETECTED") || warnings.includes("MULTIPLE_FACES_DETECTED")) { return "retake"; // no usable age, never a rejection } if (warnings.includes("LOW_LIVENESS_SCORE") || warnings.includes("LIVENESS_FACE_ATTACK")) { return "reject_spoof"; // spoof signal, never a document fallback } if (warnings.includes("AGE_BELOW_MINIMUM")) { return "reject_age"; // under the bottom of the band } const predicted = result.age_estimation; if (predicted === null) return "retake"; if (predicted >= DECLINE_THRESHOLD && predicted < BAND_TOP) return "id_verification"; return "approve";Each warning code gets its own route. A missing age is a retake, a liveness warning is a reject, and only a clean estimate inside the band goes to the document check. This table is the whole rule set:
Warning to route mapping Condition What it means Route AGE_NOT_DETECTEDThe model found no estimable age, so age_estimationis nullRetake, front-facing and well lit. Do not record a rejection. NO_FACE_DETECTEDThe liveness model found no face in the frame Retake MULTIPLE_FACES_DETECTEDMore than one person in the frame Retake alone in the frame LOW_LIVENESS_SCOREPassive liveness score at or below the liveness threshold Reject or redo liveness. Never send to a document check. LIVENESS_FACE_ATTACKA presentation attack was suspected Reject AGE_BELOW_MINIMUMPredicted age below the decline threshold you passed Reject on the selfie Clean estimate inside the band 16 to under 20 in this example ID verification Clean estimate at or above the band 20 and over in this example Approve on the selfie Send the band to ID verification. On the API route, create a session with a workflow that contains ID Verification and Face Match, sending
workflow_id,vendor_dataand acallback, then opensession.urlfor the user. On the workflow route, open the graph in Advanced mode and put a Branch node after the Liveness node: the builder lists age among its branch conditions, so the band routes to an ID Verification node and the rest of the traffic completes.
Read the fallback decision. Pull the session decision and branch on
session_kindbefore anything else.curl https://verification.didit.me/v3/session/<SESSION_ID>/decision/ \ -H "x-api-key: <API_KEY>"The key needs the
read:sessionsprivilege. The document result sits inid_verifications[]and the face comparison inface_matches[], which is present only when the workflow runs Face Match.Subscribe to
status.updated. Read the raw request body before parsing, verifyX-Signature-V2against the destination secret, reject a timestamp older than 300 seconds, then process. Return 2xx quickly and update state idempotently. The envelope carriessession_id,status,vendor_dataand, for terminal states, the decision.Set the review boundaries. A person should see the cases code cannot settle: a document that reads as expired, a face match that fails on the fallback, or an appeal from a user the selfie placed under 16. The workflow builder can route an outcome to manual review, and when a reviewer changes a status the decision records
status_overridewith theautomatic_statusit replaced, plusdecision_trace.decided_by.
What the response looks like
The shape of a successful call, as valid JSON with example values in place of live ones. A real call returns a UUID in request_id and a filled entities list.
{
"request_id": "b3f1c2d4-0000-4000-8000-000000000000",
"age_estimation": {
"status": "Approved",
"method": "PASSIVE",
"age_estimation": 22.4,
"score": 87.5,
"user_image": { "entities": [] },
"warnings": []
}
}
Two field notes. score is the passive liveness score, a number from 0 to 100, not a string. age_estimation is the predicted age in years as a float, or null when no age could be read. Status is Approved only when warnings is empty.
In the sandbox, the endpoint validates the request and then returns a static Approved payload with an age of 30 and no warnings: nothing is processed, no session is persisted and no credit is used. That also means a sandbox run never lands in the band, so test your zone logic with your own fixtures rather than waiting for the mock to change.
Inputs and outputs
| Field | Type | Required | Notes |
|---|---|---|---|
user_image | Binary | Yes | tiff, jpg, jpeg, png or webp, maximum 5 MB. One front-facing, well-lit face. The largest face wins if several are present. |
age_estimation_decline_threshold | Number, years | No | Default 18. Set it to the bottom of your buffer so the band stays available. |
face_liveness_score_decline_threshold | Number 0-100 | No | Default 30. A score at or below it adds LOW_LIVENESS_SCORE. |
save_api_request | Boolean | No | Default true. Persists the call as an API-type session you can query later. False stores nothing and the id cannot be looked up. |
vendor_data | String | No | Your own identifier for the person, echoed back on the session and in webhooks. |
rotate_image | Boolean | No | Set true when captures may arrive sideways or upside down. |
| Field | What it gives you | How to use it |
|---|---|---|
age_estimation.status | Approved or Declined | Terminal reject or approve signal, never the whole decision |
age_estimation.age_estimation | Predicted age in years as a float, or null | Drives the three-zone routing |
age_estimation.score | Passive liveness score, a number from 0 to 100 | Below the liveness threshold means spoof risk, not age risk |
age_estimation.warnings[] | Risk codes such as AGE_BELOW_MINIMUM, AGE_NOT_DETECTED, NO_FACE_DETECTED, LIVENESS_FACE_ATTACK, MULTIPLE_FACES_DETECTED | Tells a retake from a reject from a document fallback |
request_id | Session id when save_api_request is true | Read the stored result with the decision endpoint |
Failure cases and recovery
| Case | What you see | Recovery |
|---|---|---|
| Missing, oversized or wrong-format image | HTTP 400 | Resend one face, 5 MB or less, in an accepted extension. A PDF is never valid here. |
| No credit on the organization | HTTP 403, not enough credits | Top up. No image was processed and nothing was billed. |
| Bad or missing key | HTTP 403 with a permission detail | Fix the x-api-key header. This API never returns 401. |
| Write burst | HTTP 429 | The write budget is shared, 300 requests per minute per key across POST, PATCH and DELETE. Slow the caller. |
| Clear minor | Declined with AGE_BELOW_MINIMUM | Reject. Send to the document route only if your policy allows an appeal path. |
| No estimable age | Declined with AGE_NOT_DETECTED, age null | Ask for a retake, front-facing and well lit. Do not record a rejection. |
| Spoof suspected | Declined with LOW_LIVENESS_SCORE or LIVENESS_FACE_ATTACK | Reject or redo liveness. Never route a spoof signal into the document fallback. |
| Several people in frame | MULTIPLE_FACES_DETECTED | Ask the user to be alone in the frame. The largest face drives the estimate. |
Paid steps and review boundaries
Age Estimation is $0.10 per check, one check per 200 response, so a retake after AGE_NOT_DETECTED is a second billable call. The fallback is billed per completed step: ID Verification $0.15 and Face Match $0.05, plus Device and IP Analysis at $0.03 if your workflow runs it. If you run the fallback as a full KYC workflow that repeats passive liveness, that line is charged again at $0.10. The sandbox is free on every plan.
Keep the boundary clean in both directions. The call decides nothing final about a person inside the band; it only routes. A human decides when the workflow sends the session to review, and the console records who decided and what the automatic status would have been. Didit serves 4,000+ active customers. The console shows each session with its warnings, so a reviewer can see why the machine hesitated.
Worked cost example
Assume 10,000 age gates a month and 12% landing inside the band. The 12% is an assumption for the arithmetic, not a Didit figure.
- 10,000 age gates x $0.10 = $1,000.00
- 1,200 fallbacks x ($0.15 ID Verification + $0.05 Face Match) = 1,200 x $0.20 = $240.00
- Total $1,240.00, or $0.124 per gate
- Same volume running a full KYC check on every gate: 10,000 x $0.33 = $3,300.00, where $0.33 covers ID document $0.15, passive liveness $0.10, Face Match $0.05 and Device and IP $0.03
On the Scale plan the Didit discount is 10%, so Age Estimation is $0.09, ID Verification is $0.135 and Face Match is $0.045. That gives 10,000 x $0.09 = $900.00, and 1,200 x $0.18 = $216.00, for $1,116.00 for the month. A loose retake policy moves the number: if one in five selfies needs a second age call, add 2,000 x $0.10 = $200.00 at list price. A wider buffer also moves it, because every extra year of band adds fallbacks at $0.20 each instead of $0.10.
Sources
- Didit docs: Age Estimation API overview, for the error figures, the decision logic, the warnings and the two integration modes.
- Didit docs: standalone age estimation API, for request fields, the 5 MB limit, the status enum and sandbox behaviour.
- Didit docs: Age Estimation warnings catalogue, for the full risk-code list.
- Didit docs: Create Session API, for
workflow_id,vendor_dataandcallback. - Didit docs: Retrieve Session API, for
session_kind, the feature arrays and theread:sessionsprivilege. - Didit docs: Workflow builder, for branch conditions, manual review routing, and age estimation as a Liveness setting.
- Didit docs: Webhooks, for
status.updated, HMAC signing and the envelope. - Didit docs: Verification statuses, for the session lifecycle.
- Didit pricing page and the live price feed, read November 26, 2026, for $0.10 Age Estimation, $0.15 ID Verification, $0.05 Face Match, $0.03 Device and IP, $0.33 full KYC check, and the Scale plan discount.
Next step: open the sandbox at business.didit.me, enable age estimation on a Liveness node, and run the band logic with sandbox keys before you spend a credit. No sales call is needed.
Try it
Try this in the sandbox
Run the check this guide describes, free.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

Questions
Frequently asked questions
What is an age estimation buffer?
A buffer is a band of predicted ages around your legal minimum where you refuse to decide from the selfie alone. Instead of one cut at 18, you approve clearly above the band, reject clearly below it, and send the band itself to ID verification. On Didit you build it by setting the decline threshold to the bottom of the band and routing on the predicted age float.
What should I set age_estimation_decline_threshold to for an 18+ product?
Set it to the bottom of your buffer, which is 16 for a two-year buffer around 18. The default is 18, and leaving it there makes the decline bucket double as your buffer, at a width the model picks rather than one you chose. Keep your own routing on the returned age, because the status alone is a two-way answer.
When should a facial age estimate fall back to ID verification?
Whenever the predicted age lands inside the band you set around the legal minimum. The published error is the reason: a mean absolute error of 1.9 years for 18 to 20-year-olds means a face near the line cannot be settled on the estimate alone. The fallback is also the right route for an appeal from someone the selfie placed just under the line.
How accurate is Didit Age Estimation?
Didit publishes a mean absolute error of 1.1 years for 16 and 17-year-olds and 1.9 years for 18 to 20-year-olds, and states the model classifies 96% of selfies correctly as under 18 or 18 and over. Passive liveness runs in the same call, so presentation attacks can be flagged without a second request. The price is $0.10 per check.
Can I route the band inside the workflow builder without writing routing code?
Yes. The workflow builder lists age among its branch conditions, so a Branch node after the Liveness node can send the band to an ID Verification node and let the rest of the traffic complete. Build it in Advanced mode, publish the version, and run the flow in the sandbox before you take live sessions. Age estimation itself is enabled on the Liveness node, not as a separate workflow feature.
What does AGE_NOT_DETECTED mean and what should I do?
The model could not extract an age from the image, usually because the photo is blurry, dark or the face is angled away, and the predicted age comes back null. Ask for a retake with a single front-facing, well-lit face. Do not record it as a rejection, and remember the retake is another billed call at $0.10.
Does a Declined status always mean the user is underage?
No. A decline fires on any of four conditions: predicted age below your threshold, a passive liveness score at or below the liveness threshold, no face detected, or a suspected presentation attack. Read the warnings array to tell them apart. An age warning and a spoof warning need opposite handling, and only the age warning can go to a document check.
How much does an age gate with an ID fallback cost?
Age Estimation is $0.10 per check. The document route adds ID Verification at $0.15 and Face Match at $0.05 per fallback if the workflow bills those steps separately. At 10,000 gates with 12% falling back, that is $1,240.00 a month at list price, against $3,300.00 if every gate ran a full KYC check at $0.33.
What happens to age estimation calls in the sandbox?
Sandbox keys validate the request and return a static Approved payload with an age of 30 and no warnings. Nothing is processed, no session is stored and no credit is consumed. Test your zone logic with your own fixtures, because the sandbox answer never lands inside the band.
Can I use the age estimate as legal proof of age?
No. The age is model-predicted from the face, not verified against a document, and Didit's own documentation says to use it for age gates and low-friction checks rather than as legal proof of age. Use document-based verification when your policy requires document evidence, and confirm applicable legal requirements for each market.
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.
Your obligations · 3 regions
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.
- 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.
Didit Academy


