Age Estimation API reference
The Rigr AI facial age estimation API accepts images and returns an estimated age for every detected face, with a bounding box, a detection confidence score and a calibrated uncertainty value. The current model (v3) achieves a mean absolute error of approximately 1.6 years on our benchmark dataset.
It runs as a hosted cloud service or as a self-hosted Docker container for on-premise deployment, which can be air-gapped. You can get a free API key to evaluate it, read the capability overview for what the model does and where it is used, or download this reference as a PDF.
Rigr AI took part in the Australian Age Assurance Technology Trial (2025), an independent evaluation commissioned by the Australian Government and conducted by the Age Check Certification Scheme against a dataset the trial built. Its assessment found Rigr strong on technical readiness, privacy alignment and usability, with low false-positive rates in real-world scenarios.
Quick start
The hosted cloud API is available at https://api.age.rigr.ai.
# Health check (no auth required)
curl https://api.age.rigr.ai/healthz
# Verify your API key and check server info
curl -H "X-API-KEY: YOUR_KEY" https://api.age.rigr.ai/api/info
# Estimate age from an image
IMG_B64=$(base64 -w0 photo.jpg)
curl -X POST https://api.age.rigr.ai/api/image \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_KEY" \
-d "{\"images\": [\"${IMG_B64}\"]}"
The cloud API may have a cold-start delay of a few seconds on the first request if the
container has scaled to zero. Subsequent requests are fast. For a self-hosted deployment,
replace the host with your server address (for example http://localhost:8000).
Authentication
Every endpoint except /healthz requires an API key in the
X-API-KEY header. Keys are issued by Rigr AI — request one through
the self-serve signup.
X-API-KEY: your_api_key_here Endpoints
GET /healthz
Lightweight health check that verifies the server is reachable. Requires no authentication and does not wake the container on the cloud deployment, so it is safe for uptime monitoring. Returns HTTP 200 when the service is healthy.
POST /api/image
Submit one or more base64-encoded images for age estimation.
| Field | Type | Required | Description |
|---|---|---|---|
images | list[string] | Yes | Base64-encoded images. At least one is required. |
detection_threshold | float | No | Face detection confidence threshold (0 to 1). Overrides the server default. |
max_dets_per_image | int | No | Maximum number of face detections returned per image. Overrides the server default. |
Each detected face is returned as a FaceResult:
| Field | Type | Description |
|---|---|---|
idx | int | Index of this face within the image. |
age | float | Estimated age in years. |
uncertainty | float | Calibrated uncertainty of the estimate, in years. Higher values indicate lower model confidence. |
bbox | list[int] | Bounding box of the detected face as [x0, y0, x1, y1] in pixels. |
score | float | Face detection confidence score (0 to 1). |
source | string | Source filename, if available. |
Example response:
{
"error": null,
"results": [
{
"idx": 0,
"error": null,
"results": [
{ "idx": 0, "age": 25.3, "uncertainty": 1.2,
"bbox": [175, 133, 364, 378], "score": 0.9998, "source": "" },
{ "idx": 1, "age": 10.5, "uncertainty": 2.1,
"bbox": [633, 234, 725, 347], "score": 0.9993, "source": "" }
]
}
]
} GET /api/info
Returns the current pipeline configuration — model version, batch and image limits, and the detector and estimator models and devices in use. Requires authentication.
{
"version": "v3",
"max_batch_size": 20,
"max_img_mb": 50.0,
"min_img_px": 24,
"max_img_px": 6000,
"detector_model": "retinaface_resnet50",
"detector_device": "cuda",
"estimator_device": "cuda",
"estimator_model": "rigr_age_v3"
} GET /api/stats
Returns throughput statistics for the detection stage, the estimation stage and the combined pipeline — average task time, items per second, totals processed and task count. Requires authentication.
Image requirements
| Constraint | Value |
|---|---|
| Supported formats | PNG, JPEG, JPG, BMP, GIF, WebP |
| Encoding | Base64 |
| Maximum file size | 50 MB per image |
| Maximum resolution | 6000 × 6000 px |
| Minimum resolution | 24 × 24 px |
Error handling
Errors are structured JSON objects with type, message and
detail fields, returned at two levels: a top-level error that prevented the
whole request from being processed, and a per-image error affecting one image while the
rest are still processed. A per-image error can appear alongside results — a truncated
image is still processed, with the error field flagging the issue.
| Code | HTTP | Description |
|---|---|---|
base64_decoding | 400 | The provided string is not valid base64. |
image_loading | 400 | The image could not be loaded or decoded. |
image_is_truncated | 400 | The image is truncated. It is still processed, but results may be affected. |
batch_size_exceeded | 413 | The number of images exceeds the maximum batch size. |
empty_images | 422 | No images were provided in the request. |
image_size_error | 422 | The image file size exceeds the maximum limit. |
image_too_large | 422 | The image resolution exceeds the maximum allowed dimensions. |
image_too_small | 422 | The image resolution is below the minimum required dimensions. |
model_runtime | 500 | An error occurred during model inference. |
model_loading | 500 | The model could not be loaded. |
invalid_api_key | 401 | The provided API key is invalid or expired. |
missing_api_key | 401 | No X-API-KEY header was provided. |
A request body that does not conform to the expected schema returns HTTP 422 with a
RequestValidationError listing each offending field.
Deployment
Cloud (evaluation). The fastest way to evaluate is the hosted instance at
https://api.age.rigr.ai — no infrastructure setup required. The cloud
deployment runs the lite (ONNX-only, CPU) container.
Self-hosted and air-gapped. Pre-built Docker images support CPU and GPU (CUDA) inference. All images expose the same API on port 8000, so only the host changes. Contact us for registry access, image tags and deployment guidance.
| Image | Size | Use case |
|---|---|---|
rigrage-api:v3-cuda-12.9.1 | ~8 GB | GPU inference (highest throughput) |
rigrage-api:v3-cpu | ~5 GB | CPU inference with PyTorch |
rigrage-api:v3-cpu-lite | ~1.6 GB | CPU inference, ONNX-only (smallest, fastest cold start) |
Getting access
Get a free API key Talk to us about deployment
Also available: the Age Estimation capability overview, the Trust & Safety solution page for review-routing workflows, and this reference as a PDF.