Skip to main content

Developer's Guide to Zero-Knowledge Proofs for Age Verification

Didit does not issue zero-knowledge proofs. We return the age decision, $0.10 per Age Estimation check or $0.15 per ID Verification step, and you wrap it in a proof. A model-estimated age is an age gate, not legal proof.

Developer's Guide to Zero-Knowledge Proofs for Age Verification

Contents

In this guide

Jump to the part you need.

This guide is for developers who must gate an age-restricted product and want to keep dates of birth out of their database. Didit does not issue zero-knowledge proofs itself: we return an age decision you can fold into a proof, priced at $0.10 per Age Estimation check. The caveat is that a model-estimated age is an age gate, not legal proof of age.

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

Didit pieces for a privacy-preserving age gate, USD list prices on November 26, 2026
PieceWhat it returnsPriceWhere it is documented
Age Estimation APIPredicted age in years, passive liveness score, Approved or Declined$0.10 per call, passive liveness includeddocs.didit.me, standalone APIs, age estimation
ID Verification in a workflowDocument fields including date of birth, MRZ, fraud warnings, MIN_AGE_NOT_REACHED$0.15 per checkdocs.didit.me, core technology, ID verification
ID Verification API, direct uploadSame fields, one-shot server to server$0.20 per callPrice book line "ID verification API"
Passive Liveness stepLiveness score 0 to 100, presentation-attack flags$0.10 per check as its own stepdocs.didit.me, age estimation methods
Full ID check (KYC)Document, biometrics and device and IP in one check$0.33 per checkdidit.me/pricing
Workflow orchestrator, MCP server, SDKsToolingFree on every plandocs.didit.me

Start free in the sandbox at business.didit.me, no sales call, unlimited testing. For developers, connect Didit to an AI assistant through Didit MCP. The product pages you will need are Age Estimation, ID Verification and pricing.

What a zero-knowledge age check actually needs

A zero-knowledge age check has three parts. An issuer makes a statement about the person, for example "this passport holder's birth date makes them over 18" or "the face in this selfie is estimated at 24 years". A prover builds a proof that the statement satisfies a predicate such as "age is at least 18" without revealing the underlying value. A verifier checks the proof and stores the yes or no answer.

The first part is the one that is easiest to get wrong. A proof is only as good as the claim it wraps. If the age was estimated from a selfie, the proof shows that Didit estimated an age, not that the person is legally an adult. If the age came from a passport read by ID Verification, the proof can carry document assurance and an expiry check.

Didit supplies the first part and enforces the threshold on our side. You supply the proof, or you accept the threshold decision without one.

What Didit does and does not do

We do not generate zk-SNARKs or zk-STARKs, and we do not run a circuit for you. Here is what the platform gives you instead:

  • Age Estimation API. A predicted age from one selfie with passive liveness in the same call, $0.10. Mean absolute error is 1.1 years at ages 16 and 17 and 1.9 years at 18 to 20, and 96% of selfies are correctly classified as under 18 or 18 and over.
  • ID Verification. Document OCR, MRZ and barcode decoding, authenticity checks, and a minimum_age request field that produces the MIN_AGE_NOT_REACHED warning. $0.15 in a workflow, $0.20 through the direct API.
  • Sessions and webhooks. A hosted flow at session.url, a decision endpoint, and a status.updated webhook signed with HMAC-SHA256.
  • Digital ID wallets. Where a national eID or bank identity signs the attributes, the result carries the cryptographic assurance tier. Google Wallet ID is $0.10, MitID is $0.25.

If a regulator or a partner demands an actual zero-knowledge attestation, you build the proof layer and use a Didit decision as the private input. We do not document a proof format and we will not pretend otherwise.

Prerequisites

  • A Didit application and an API key from the Business Console, sent in the x-api-key header.
  • Prepaid credit. The Free plan includes $10.00 of monthly credit for organizations that sign up with a work email, and the sandbox costs nothing.
  • Base URL https://verification.didit.me for the standalone APIs.
  • A face image in jpg, jpeg, png, tiff or webp, maximum 5 MB. PDFs are not accepted on this endpoint.
  • For the session route, a workflow with the LIVENESS feature and age estimation enabled, plus its workflow UUID.
A user face being scanned during the selfie capture step
The selfie capture that feeds Age Estimation. One clear, front-facing, well-lit face per image.

How to add an age gate that a proof can wrap

Outcome: an age decision your backend can trust, expressed as a value you can hand to a prover, without keeping the document or the birth date. Method: Age Estimation for the default path, ID Verification when the policy needs a document-backed date of birth.

  1. Decide what evidence your gate needs against your own risk and compliance policy. A selfie-based estimate may be appropriate where your policy accepts a model-estimated age band. A document read is needed where the age must be tied to a legal identity, or where a regulator or partner requires document-backed evidence.
  2. Pick the delivery mode. Mode A runs age estimation inside the hosted Liveness step of a session, so there is no separate age feature. Mode B is the standalone server-to-server call when you already hold the selfie.
  3. Configure the threshold. Set age_estimation_decline_threshold to the age your policy requires. The default is 18. A Challenge 21 style gate uses 21, and the same field applies on the standalone call.
  4. Make the call. The standalone request below runs as written once you replace the key and the image path:
    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'
  5. Read the decision, not just the HTTP code. A 200 can still carry status: "Declined". Check age_estimation.status and the warnings array on every response.
  6. Fetch the session decision if you used Mode A. Call GET /v3/session/{sessionId}/decision/ and read liveness_checks[].age_estimation. The result does not appear in a top-level age_estimations[] array.
  7. Record only what you need. Set save_api_request=false and nothing is stored: request_id becomes a one-off correlation UUID that cannot be looked up later. Leave the default true and the call is persisted as an API-type session in the console, the face crop is stored, and the face embedding joins your application's face index.

Expected output

The documented response shape for a successful call:

{
  "request_id": "<session id, or a one-off correlation id>",
  "age_estimation": {
    "status": "Approved",
    "method": "PASSIVE",
    "age_estimation": <predicted age in years>,
    "score": <passive liveness score, 0 to 100>,
    "user_image": { "entities": [ ... ] },
    "warnings": []
  }
}

Status is Approved only when warnings is empty. Sandbox keys skip all processing and billing: after request validation the endpoint returns a static Approved mock with age_estimation: 30 and no warnings, no session is persisted and no credits are used. A passing sandbox test proves your integration, not the model.

A liveness result in the Didit Business Console session detail
Where the decision lands in the console: the Liveness entry that carries the age estimation result.

Inputs and outputs

Age Estimation API fields
FieldDirectionRequiredNotes
user_imageInputYesFace photo. The largest face in the frame drives the estimate.
age_estimation_decline_thresholdInputNoDefault 18. Below this value the response declines with AGE_BELOW_MINIMUM.
face_liveness_score_decline_thresholdInputNoDefault 30. A liveness score at or below it adds LOW_LIVENESS_SCORE.
rotate_imageInputNoSet when captures may be sideways or upside down.
save_api_requestInputNoDefault true. false stores nothing and returns a correlation id.
vendor_dataInputNoYour stable user identifier, used for duplicate detection.
request_idOutputAlwaysA real session id when the call is persisted.
age_estimation.statusOutputAlwaysOne of Not Started, In Progress, Approved, In Review, Declined, Abandoned, Kyc Expired.
age_estimation.age_estimationOutputAlwaysFloat in years, or null when the age could not be estimated.
age_estimation.scoreOutputAlwaysPassive liveness score, 0 to 100.
age_estimation.warningsOutputAlwaysRisk codes including AGE_BELOW_MINIMUM, AGE_NOT_DETECTED, LOW_LIVENESS_SCORE, NO_FACE_DETECTED, LIVENESS_FACE_ATTACK, MULTIPLE_FACES_DETECTED.

Failure cases and recovery

What to do when the call does not go the way you planned
SignalMeaningRecovery
HTTP 400Missing or oversized user_image, or an unsupported extensionValidate size and type on the client before sending, then resend
HTTP 403, not enough creditsThe organization balance cannot cover the call, raised before any image processingTop up or raise the plan, then retry
HTTP 403, permission messageMissing or invalid API key. This API never returns 401Check the x-api-key header and the key's scopes
HTTP 429Shared write budget of 300 requests per minute per key is exceededBack off and spread the writes
Declined with AGE_BELOW_MINIMUMThe predicted age is under your thresholdReject for this product. Do not retry to get a different answer
Declined with LOW_LIVENESS_SCORE or LIVENESS_FACE_ATTACKA presentation attack is suspectedReject, or step up to the ID Verification path
AGE_NOT_DETECTEDThe model could not extract an age, usually image qualityAsk for a retake with better light and a single front-facing face
MULTIPLE_FACES_DETECTEDMore than one face in frameAsk the user to capture alone
In Review on a documentA document check could not reach a decision, for example DOCUMENT_LIVENESS_NOT_COMPUTEDRoute to your manual queue. Never approve an In Review result automatically

Two boundaries matter more than the error codes. First, a decline is a decision, not an exception, so do not wrap it in a retry loop. Second, the model's error grows for faces close to your threshold, and the docs recommend a fallback to document-based verification for borderline ages.

Where the zero-knowledge proof fits

Once you hold a Didit decision, the proof layer is yours. Keep the boundary clear: Didit returns a decision. In wallet flows, the identity provider signs the attributes and the result carries the cryptographic assurance tier. Your prover decides what to prove and what to reveal. We do not document a proof format, a circuit, or a proof lifecycle, so treat any design here as your own engineering and compliance decision.

What Didit contributes is the private input: age_estimation in years, or the date of birth from id_verification, plus the liveness score that says a live person was present. vendor_data is the identifier that ties the Didit decision to your own user record.

If you need a document-free path for users who should not hand over an ID, start with Age Estimation at $0.10 and escalate only the borderline cases. That can reduce the personal data you collect, and it maps cleanly onto the data minimisation principle in Article 5 of the GDPR.

Age verification without an ID document

Age Estimation is the no-document route. The user takes a selfie, the model predicts an age, passive liveness confirms a live person, and your backend receives a status. In the interface Didit blurs the user's face during the passive check so it reads as an age estimate rather than an identity check. Nothing about this is a legal proof of age, and that distinction belongs in your own copy as well as your risk file.

Sign in with a national eID or a bank identity is the other no-document route, with the cryptographic assurance tier because the provider signed the attributes. Available today: MitID at $0.25, BankID Sweden at $0.20, iDIN at $0.95, Finnish Trust Network at $0.25, Smart-ID and Mobile-ID at $0.21, Bank iD at $0.20 and Google Wallet ID at $0.10.

An ID document result in the Didit Business Console session detail
The fallback when a selfie estimate is borderline: the document path returns a date of birth your policy can rely on.

Age assurance, Challenge 21 and AI platforms

A Challenge 21 policy asks anyone who looks under 21 for proof, and it is a policy question before it is a technical one. In Didit you set age_estimation_decline_threshold to 21 and route the borderline band to ID Verification, which is the same pattern used for 18. Keep a written record of which method applies to which surface.

For AI platforms and agents the gate belongs to the account, not to the prompt. Verify once when the account is created, store the decision, and re-check when the account's stored age crosses a threshold. Our MCP server lets a coding agent read the API and wire the calls while you are building, and it is free on every plan: MCP setup for every client.

Worked cost example

Assume 250,000 first-time age checks a month and a policy that sends every borderline estimate to a document check. Assume 8% of users land in that band.

  • Age Estimation at list price: 250,000 x $0.10 = $25,000.00
  • Borderline users: 250,000 x 0.08 = 20,000 ID Verification steps
  • ID Verification in a workflow: 20,000 x $0.15 = $3,000.00
  • Total at list price: $25,000.00 + $3,000.00 = $28,000.00
  • Same volume on Scale with 10% off Didit prices: 250,000 x $0.09 = $22,500.00, plus 20,000 x $0.135 = $2,700.00, total $25,200.00 before the $299 monthly fee

If the same product also needs a full identity check and AML on every user, the iGaming bundle lists at $0.63: $0.33 full ID check plus $0.20 AML screening plus $0.10 Age Estimation. At 250,000 users that is 250,000 x $0.63 = $157,500.00.

What is billed, what is free, and where a person must look
StepBilledPriceReview boundary
Sandbox callsNo$0.00, unlimitedReturns a static mock, so it proves the integration and not the model
Age Estimation APIYes, one credit per 200 response$0.10A decline is a decision; do not auto-retry it
ID Verification step in a workflowYes$0.15In Review goes to a person
ID Verification APIYes$0.20DOCUMENT_LIVENESS_NOT_COMPUTED means the forgery check did not run
MCP server, workflow orchestrator, SDKsNoIncludedNone

Borderline ages are a review boundary too, not a technical detail. Send them to the document path and record which method produced each decision.

Sources

Next step: open the sandbox at business.didit.me, create an application, and run the age estimation call with a test selfie. No sales call, no contract, and the first $10.00 of monthly credit is on us on the Free plan.

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

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Frequently asked questions

What is zero-knowledge proof age verification?

It is a way to prove a person meets an age threshold without revealing their date of birth. An issuer attests to the age, a prover builds a cryptographic proof that the value satisfies the predicate, and the verifier learns only pass or fail. The privacy gain is real, but the proof is only as trustworthy as the issuer behind it.

Can Didit generate a zero-knowledge proof of age?

No. Didit returns an age decision from the Age Estimation API at $0.10 per check, or a document-backed date of birth from ID Verification at $0.15 in a workflow, and you build the proof layer on top. We do not document a proof format. You can use our decision as the private input to your own prover.

Is there an age verification API I can call server to server?

Yes. POST https://verification.didit.me/v3/age-estimation/ takes one face image and returns a predicted age, a passive liveness score and a decision, at $0.10 per call. Send your key in the x-api-key header and use multipart/form-data. The same endpoint is documented in full in the standalone API reference.

How much does an age verification API cost?

Age Estimation is $0.10 per check with passive liveness included. A document fallback is $0.15 per ID Verification step in a workflow, or $0.20 through the direct upload API. A full ID check is $0.33, and the Free plan includes $10.00 of monthly credit with a free sandbox.

What is the difference between age estimation and age verification?

Age estimation predicts an age from a face; age verification reads a date of birth from a document or a signed wallet attribute. Didit prices them separately at $0.10 and $0.15. Estimation is the lighter gate and document verification is the evidence-backed one. Running both, with estimation first and document fallback for borderline cases, is an optional policy choice rather than a default.

How accurate is AI age estimation near 18?

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 96% of selfies are correctly classified as under 18 or 18 and over. Error grows near the threshold, which is why the docs recommend a document fallback for borderline ages. Treat the score as a gate, not a legal finding.

Can I verify age without an ID document?

Yes, on two routes. Age Estimation reads a selfie for $0.10 with no document at all. A digital ID wallet sign-in returns signed attributes from a national eID or bank for $0.10 to $0.95 depending on the wallet. Neither route requires the user to upload an identity document.

Is there a free age verification system for testing?

The sandbox is free and unlimited on every plan. Sandbox keys return a static Approved mock with age_estimation: 30 and consume no credits, so you can build the whole flow before you pay. For live traffic the Free plan includes $10.00 of monthly credit, which covers 100 Age Estimation checks at list price.

How do I integrate age verification into my app?

Create a workflow with the Liveness feature and age estimation enabled, create a session with POST /v3/session/, send the user to session.url, then read GET /v3/session/{sessionId}/decision/ or wait for the status.updated webhook. If you already hold the selfie, call the standalone endpoint instead and skip the session.

Does Didit work for age verification systems on AI platforms?

Yes, with the same API. Verify the account holder once at signup, store the decision next to the account, and re-check when the stored age crosses a threshold. For agent building work, the free MCP server lets an AI assistant read the API and wire the calls from the docs.

What is age assurance and how does Challenge 21 map to an API?

Age assurance is the regulator's word for knowing a user's age band well enough for the risk of the product. Challenge 21 maps directly to one field: set age_estimation_decline_threshold to 21 and send the borderline band to ID Verification. Keep a written record of which method covers which surface.

Does age estimation help with GDPR data minimisation?

It reduces what you collect: one selfie, a predicted age and a liveness score, with no document image and no stored birth date when you send save_api_request=false. That supports the minimisation principle in Article 5 of the GDPR. It does not by itself make a flow compliant, since you still need a lawful basis and a retention rule.

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.