Pre-generation Age Check

When you create an image-to-video, reference-to-video, or image task that includes images, the system first checks the age of the people in the images and starts generating only after confirming there are no minors. Requests without images (such as text-to-image or text-to-video) are not checked.

The age check is free of charge. If a task is blocked, the credits charged for it are fully refunded.

Flow

  1. When you create a task, credits are charged as usual and the task status is 2 (age check in progress).
  2. Each image is checked separately. Once all are done, the outcome is decided according to the table below:
Result Condition Handling
Adult Every face in every image is judged to be an adult The task becomes 0 (queued) and is generated as usual
Uncertain Any face's age is close to the adult threshold, or no face is found in an image Without age_declared: true: the task fails (face_age_uncertain) and is fully refunded. With it: generated as usual
Minor Any face is judged to be a minor The task fails (face_age_minor) and is fully refunded. It is blocked even if age_declared is sent

Detection usually completes within a few seconds. Until it completes, the task stays at 2, and during this time you can cancel the task for a full credit refund.

age_declared parameter

Field Type Required Description
age_declared boolean No Send true to confirm that everyone in the images is an adult. This only lets "Uncertain" cases through; "Minor" cases are always blocked

Recommended approach: don't send age_declared on the first submission. If you receive face_age_uncertain, ask your user to confirm that everyone in the photo is an adult, then resubmit with age_declared: true.

curl -X POST https://yuyuvideo.com/api/tasks/video-generation \
  -H "X-Api-Key: sk-live-xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YUYU_M1",
    "prompt": "a person walking on the beach",
    "images": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."],
    "age_declared": true
  }'

error_code on failure

A blocked task has a status of 30. After you query the task or receive a Callbacks (Webhook) notification, check error_code for the reason:

error_code Cause Recommended action
face_age_minor The image contains a minor Use a different image; do not resubmit the same one
face_age_uncertain Could not confirm that the people are adults (age close to the adult threshold, or no face found) After confirming everyone is an adult, resubmit with age_declared: true
face_check_failed The detection service is temporarily unavailable Try again later

All three cases are fully refunded.