How to Add Selfie Age Verification to Your App (No ID)
Send one selfie to POST /v3/age-estimation/ and receive estimated age, passive liveness, and Approved or Declined status for $0.10 per check. No ID or user challenge is required. The estimate is not legal proof of age.

Contents
In this guide
Jump to the part you need.
You can add selfie-based age verification to an app with one server-side call to POST /v3/age-estimation/. You send one face photo and get back an estimated age, a passive liveness score and an Approved or Declined status for $0.10 per check. It fits age gates in age-gated services where asking every user for a passport loses sign-ups. The caveat is real: the age is model-predicted, not legal proof of age.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | What you get |
|---|---|
| Endpoint | POST https://verification.didit.me/v3/age-estimation/ |
| Input | One face photo in user_image. tiff, jpg, jpeg, png or webp. Maximum 5 MB. No PDF. |
| Output | age_estimation in years, a passive liveness score from 0 to 100, an Approved or Declined status, and a warnings array. |
| User effort | No ID document, no head turn, no challenge. One front-facing photo. |
| Default age threshold | 18 years through age_estimation_decline_threshold. Set it to 0 to disable the age check. |
| Default liveness threshold | 30 through face_liveness_score_decline_threshold. |
| Decision rule | Status is Approved only when the warnings array is empty. |
| Price | $0.10 per check. $0.096 on Growth, $0.09 on Scale. |
| Sandbox | Static Approved mock with age_estimation: 30 and no warnings. No credits used, nothing stored. |
| Authentication | Your application API key in the x-api-key header. A missing or invalid key returns 403, never 401. |
Start free in the sandbox at business.didit.me, with no sales call. The product documentation is Didit Age Estimation. If you want an AI assistant to write the integration with you, connect Didit through the Didit MCP server. Plans and every unit price are on didit.me/pricing.
What the selfie age check does, and when it is the wrong tool
The endpoint analyzes the faces in the image with age-estimation and passive-liveness models, and the liveness model looks for presentation attacks such as a printed photo, a screen replay or a mask. Didit returns the age of the largest face in the frame, so a bystander in the background does not drive the number. Inference is documented as sub-2-second, and the call is priced at $0.10.
Use it for age gates, not for regulated identity proofing. The documentation states the model's mean absolute error is 1.1 years for 16 and 17-year-olds and 1.9 years for 18 to 20-year-olds, and that it classifies 96% of selfies correctly as under 18 or 18 and over. That is strong for a gate, and still an estimate. Where a rule demands documentary proof of age, or the estimate lands right on your threshold, fall back to a full ID check at $0.33 per completed KYC.

Prerequisites
- A Didit application. Create one in the Business Console; it comes with a primary API key.
- An API key from Developers, then API keys. Sandbox keys start with
sk_test_and live keys withsk_live_; serve them from your backend only. - A test selfie in jpg, jpeg, png, tiff or webp under 5 MB.
- For live calls, credit on your plan. Each 200 response consumes one Age Estimation API credit at $0.10.
- An HTTP client. The examples below use cURL, and the same multipart form works from any language. The integration prompt is the shortcut if a coding agent is writing the code.
Step-by-step: add selfie age verification
- Decide the age you gate at. Pick the value you pass in
age_estimation_decline_threshold. The default is 18. If you only need the estimate and the liveness score for your own logic, send 0 to disable the age comparison entirely. - Decide how strict liveness is.
face_liveness_score_decline_thresholddefaults to 30 on a 0 to 100 scale. Raise it if your fraud rate justifies rejecting more borderline captures. - Take the selfie on the client and post it to your server. The image goes to your backend, and your backend calls Didit. Never put the API key in a browser or a mobile bundle.
- Call the endpoint with the multipart form below. Add
rotate_image=trueif captures can arrive sideways or upside down. - Read
warningsbefore you readstatus. Approved means the array is empty. Any warning, even one you consider minor, produces Declined. - Branch on the warning code, not only on the status: a retake for
AGE_NOT_DETECTED, a rejection forAGE_BELOW_MINIMUM, a reject or a document fallback forLOW_LIVENESS_SCOREandLIVENESS_FACE_ATTACK. - Store the decision. With
save_api_request=true, which is the default, the returnedrequest_idis a real session id, so you can callGET /v3/session/{sessionId}/decision/later or listen for thestatus.updatedwebhook. - Test in sandbox first. A sandbox key returns a fixed Approved payload, so you can wire your branches without spending credit.
The call, exactly as documented
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=18' \
-F 'save_api_request=true' \
-F 'vendor_data=user-1234'
Add -F 'rotate_image=true' when mobile captures may not be upright, and -F 'face_liveness_score_decline_threshold=30' to set the liveness cut-off explicitly instead of relying on the default.
Inputs you send
| Field | Default | What it does |
|---|---|---|
user_image | Required | The face photo. tiff, jpg, jpeg, png or webp, maximum 5 MB. Submit one front-facing, well-lit face per image. |
age_estimation_decline_threshold | 18 | Declines with AGE_BELOW_MINIMUM when the estimated age is under this value. Send 0 to disable the age check. |
face_liveness_score_decline_threshold | 30 | Declines with LOW_LIVENESS_SCORE when the passive liveness score is at or below this value. |
rotate_image | false | Handles sideways and upside-down mobile captures before face analysis. |
save_api_request | true | Persists the call as an API-type session in the Business Console, keeps the face crop and reference image, adds the face embedding to your face index and emits a status.updated webhook. Set false for a one-off correlation id that cannot be looked up later. |
vendor_data | None | Optional value included in the documented request example. |
| Idempotency key header | None | Optional request-deduplication key. |
Outputs you read
| Field | Meaning |
|---|---|
request_id | The session id when save_api_request is true, otherwise a one-off correlation UUID. |
age_estimation.status | Approved or Declined. Approved only when warnings is empty. |
age_estimation.method | PASSIVE for this endpoint. No user challenge is required. |
age_estimation.age_estimation | The predicted age in years for the largest detected face, or null when no age could be estimated. |
age_estimation.score | Passive liveness score from 0 to 100. |
age_estimation.user_image.entities | The face entities detected in the image. |
age_estimation.warnings | Risk codes. Any entry declines the call. |
Expected output
The payload below is illustrative. The shape follows the documented response, and the values are example values, not a fixed reply you will always get back.
{
"request_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"age_estimation": {
"status": "Approved",
"method": "PASSIVE",
"age_estimation": 24.6,
"score": 94.2,
"user_image": { "entities": [ ... ] },
"warnings": []
}
}
Read as an example: the largest face was estimated at 24.6 years, the passive liveness model scored it 94.2 out of 100, and nothing landed in warnings, so this call is Approved. Flip one warning into the array and the same call comes back Declined with the reason attached.

save_api_request defaults to true, the call is stored and its liveness and age result can be reviewed in the console.Failure cases and how to recover
| What you see | What it means | What to do |
|---|---|---|
| HTTP 400 | Missing or oversized user_image, or an unsupported extension. | Send one image under 5 MB in tiff, jpg, jpeg, png or webp. PDFs are rejected. Malformed input is validated even in sandbox. |
| HTTP 403 with the permission detail | Missing or invalid API key. This API never returns 401. | Send a valid key in x-api-key from your application in the console. |
| HTTP 403 not-enough-credits | Your balance cannot cover the call. The endpoint refuses before any image processing. | Top up or switch to the sandbox key. Top-ups run from $50 to $20,000. |
| HTTP 429 | The shared write budget of 300 requests per minute per API key is exhausted. | Back off and retry. The limit covers every POST, PATCH and DELETE on that key. |
Declined with AGE_BELOW_MINIMUM | The estimated age is under your age_estimation_decline_threshold. | Reject the sign-up or gate the feature. If the estimate sits right on the line, offer the document path. |
Declined with AGE_NOT_DETECTED | No estimable face age. age_estimation is null, usually because of image quality, angle, blur, low light or a face too small in frame. | Do not reject on this code. Ask for a retake: fill more of the frame, front-facing, even light, no filter. |
Declined with LOW_LIVENESS_SCORE | The passive liveness score is at or below face_liveness_score_decline_threshold, 30 by default. | Treat as a suspected spoof. Ask for a retake once, then reject, or escalate to the document route. |
Declined with LIVENESS_FACE_ATTACK | The liveness model flagged a presentation attack. | Reject. This is a strong signal, not a lighting problem. |
Declined with NO_FACE_DETECTED | The liveness model found no face in the image. | Reject the upload as unusable and request a new photo. |
Declined with MULTIPLE_FACES_DETECTED | More than one face is in the frame. | Ask for a photo of the user alone. Only the largest face drives the age, so a group shot is not a reliable result. |
Embedding age estimation inside a hosted flow
If you use Didit hosted sessions rather than the standalone call, age estimation is not a separate workflow step. It is embedded inside the Liveness node. Enable it on that node in the Business Console and set age_estimation_decline_threshold there, create the session with POST /v3/session/, open session.url for the user, then read the result at liveness_checks[].age_estimation from GET /v3/session/{sessionId}/decision/. It is not a top-level age_estimations[] array, which is the most common integration mistake with this product.
In that mode the passive liveness UI shows the user's face blurred on screen, so the person can see that the frame is analysed for age and not for identification.
Sandbox and test mode
Sandbox is per application, not per account. With a sandbox key, the age estimation endpoint validates the request and then returns a static Approved mock with age_estimation: 30 and no warnings. No session is persisted and no webhook fires. So do not expect a session decision in sandbox from this call: the liveness_checks[] entry with features: ["AGE_ESTIMATION"] appears on sessions created in a live application with save_api_request=true.
Sandbox testing is free and unlimited. The static Approved mock tests your request shape and your success path directly, while warning handling has to be tested against the documented warning codes as fixtures or against live outcomes. The full scenario list is in the sandbox testing docs.

Worked cost example
Say you run 40,000 age estimations a month and 5% of them land near the threshold and escalate to a full ID check.
- List price: 40,000 x $0.10 = $4,000.00.
- Growth: 40,000 x $0.096 = $3,840.00. The $115 monthly credit pays the first $115.00, leaving $3,725.00 from top-up. Add the $99.00 monthly fee for a total of $3,824.00.
- Scale: 40,000 x $0.09 = $3,600.00 minus the $350.00 monthly credit = $3,250.00 from top-up, plus the $299.00 fee = $3,549.00.
- Escalations: 2,000 x $0.33 full KYC = $660.00 at list price, on top of whichever plan you choose.
- For reference, running all 40,000 users through a full ID check at $0.33 would be $13,200.00 before any discount.
The arithmetic is the point: the selfie gate is a third of the price of a document check, and you only pay the document price for the users who need it. Current plans and unit prices are listed on didit.me/pricing.
Paid steps and review boundaries
Every live 200 response consumes one Age Estimation API credit. Sandbox calls are free and do not consume credits. A 400, a 403 or a 429 consumes nothing. The call accepts an optional idempotency key header, documented in the API reference. The 300 requests per minute write budget is shared with your other write calls, so budget it alongside your session creation traffic.
The standalone call returns Approved or Declined and has no human review step inside it. If your policy requires a person to look at borderline ages, route those results into your own queue, or run the user through a document-based session where the console gives your reviewers the full session, the face crop and the warnings. Nothing on this endpoint turns an estimate into proof of age, and no reviewer can change that.
Sources
- Didit docs: Age Estimation API
- Didit docs: Selfie age verification overview
- Didit docs: Age estimation warnings catalogue
- Didit docs: Pricing and billing
- Didit docs: Sandbox test data
- Didit docs: API errors
- Didit docs: Verification statuses
- Didit docs: API authentication
- Didit integration prompt
- Didit pricing page and the live price feed read November 26, 2026
- Didit MCP server
Next step: create a sandbox application and run one call with rotate_image=true against a real phone photo. It takes about a minute and costs nothing. Start at business.didit.me, with no sales call.
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
Can Didit verify age without an ID document?
Yes. POST /v3/age-estimation/ estimates age from a single selfie using a face model, with passive liveness in the same call. No document is uploaded and the user performs no challenge. The result is an estimate, so it suits age gates, not legal proof of age.
How accurate is selfie age estimation?
Didit documents a mean absolute error of 1.1 years for 16 and 17-year-olds and 1.9 years for 18 to 20-year-olds, with 96% of selfies correctly classified as under 18 or 18 and over. Accuracy is best exactly where age gating matters. Near your threshold the error grows, so add a document fallback for borderline cases.
What does AGE_NOT_DETECTED mean on an age estimation call?
It means the model could not extract an age from the image, so age_estimation comes back null and the call is Declined. The usual cause is image quality: a face too small in the frame, blur, low light, a sharp angle or a heavy filter. Ask for a retake rather than rejecting the user, because this code says nothing about the person's age.
Why did my call return Declined with AGE_BELOW_MINIMUM?
The estimated age was below the value in age_estimation_decline_threshold, which defaults to 18. If you set the threshold yourself, check the value you sent. If you sent 0 to disable the age check, this warning cannot fire. Reject or gate the feature, and offer the document route when the estimate is within a year of the line.
What does LOW_LIVENESS_SCORE mean and should I reject?
The passive liveness score fell at or below face_liveness_score_decline_threshold, 30 by default. That points to a spoof or a poor capture. Ask for one retake in good light, then reject if it repeats, or escalate the user to a document check where the identity is established a different way.
How much does the age estimation API cost?
It is $0.10 per check on the list price, $0.096 on the Growth plan and $0.09 on Scale. Each 200 response consumes one credit, and a call that fails with 400, 403 or 429 consumes nothing. Sandbox calls are free.
How do I set the age threshold or turn the age check off?
Send age_estimation_decline_threshold on the request, or set it on the Liveness node in the console if you use hosted sessions. The default is 18. Send 0 to disable the age comparison completely and keep only the liveness result and the estimate for your own logic.
Does the sandbox return real age results?
No. A sandbox key returns a static Approved mock with age_estimation: 30 and no warnings after request validation, with no session persisted and no credits used. Use it to test your request shape and your success branch, and test your warning branches against the documented warning codes.
Where do I find the age estimation result in a session decision?
It sits at liveness_checks[].age_estimation on each Liveness entry of GET /v3/session/{sessionId}/decision/, with features: ["AGE_ESTIMATION"]. There is no top-level age_estimations[] array, so parsing the wrong path is a common cause of empty results.
How do I handle sideways selfies from mobile cameras?
Send rotate_image=true with the call. The API rotates the image before face analysis, which prevents a correct photo from failing as NO_FACE_DETECTED or AGE_NOT_DETECTED just because the phone was held at an angle.
What happens if there are two people in the photo?
The largest face in the frame drives age_estimation, and MULTIPLE_FACES_DETECTED is added to warnings, which makes the call Declined. Ask for a photo of the user alone, well lit and front-facing, for a reliable result.
Is a selfie age estimate legal proof of age?
No. Didit's documentation is explicit that the age is model-predicted from the face and not verified against a document, so it is meant for gates and low-friction checks. Where a rule requires documentary proof, use a full ID check at $0.33 per completed check, or one of the digital ID wallet methods Didit publishes.
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


