Ir al contenido principal

API de recurso de persona real

El cliente de la API no inicia sesión en YingTu, pero la persona representada debe completar identidad, consentimiento y prueba de vida en el H5 oficial.

Endpoint

Base URL

Text
https://yingtu.ai
HTTP
POST /api/seedance-assets/real-persons/verifications
HTTP
GET /api/seedance-assets/real-persons/verifications/{verification_id}
HTTP
POST /api/seedance-assets/real-persons
HTTP
GET /api/seedance-assets/real-persons/{id}

Autenticación

El cliente no inicia sesión en YingTu ni Google. Envía la API Key de LaoZhang mediante Authorization: Bearer <LAOZHANG_API_KEY>.

CabeceraObligatorioDescripción
AuthorizationSíAPI Key de LaoZhang mediante autenticación Bearer.
Content-TypeSolo POSTLas operaciones de creación usan application/json.

Solicitud

POST /api/seedance-assets/real-persons/verifications

CampoObligatorioDescripción
callback_urlSíURL HTTPS que se abre al terminar la verificación.
languageNoIdioma H5 oficial: zh, en o zh-Hant. Predeterminado: zh.

GET /api/seedance-assets/real-persons/verifications/{verification_id}

CampoObligatorioDescripción
verification_idSíParámetro de ruta devuelto al crear la verificación.

POST /api/seedance-assets/real-persons

CampoObligatorioDescripción
verification_idSíDebe estar verified y pertenecer a la misma API Key.
image_urlSíURL HTTPS pública de una imagen frontal nítida de la misma persona.
nameNoNombre del recurso, hasta 64 caracteres.

Solicitud de creación

Shell1. POST /verifications
curl --request POST \
  --url https://yingtu.ai/api/seedance-assets/real-persons/verifications \
  --header "Authorization: Bearer $LAOZHANG_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "callback_url": "https://customer.example.com/seedance/verified",
    "language": "en"
  }'
Shell2. GET /verifications/{verification_id}
curl --request GET \
  --url https://yingtu.ai/api/seedance-assets/real-persons/verifications/ver_eyJvcGFxdWUiOiJleGFtcGxlIn0 \
  --header "Authorization: Bearer $LAOZHANG_API_KEY"
Shell3. POST /real-persons
curl --request POST \
  --url https://yingtu.ai/api/seedance-assets/real-persons \
  --header "Authorization: Bearer $LAOZHANG_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "verification_id": "ver_eyJvcGFxdWUiOiJleGFtcGxlIn0",
    "image_url": "https://cdn.example.com/presenter.webp",
    "name": "presenter-a"
  }'

Ejemplo de respuesta

HTTPPOST /verifications · 201
HTTP/1.1 201 Created
Content-Type: application/json

{
	  "request_id": "req_01JZEXAMPLE",
	  "verification_id": "ver_eyJvcGFxdWUiOiJleGFtcGxlIn0",
	  "status": "requires_user_action",
	  "verification_url": "https://official-h5.example/?...&lng=en",
	  "callback_url": "https://customer.example.com/seedance/verified",
	  "expires_at": "2026-07-29T05:30:00.000Z"
	}
JSONGET /verifications/{id} · 200 pending
{
  "request_id": "req_01JZEXAMPLE",
  "verification_id": "ver_eyJvcGFxdWUiOiJleGFtcGxlIn0",
  "status": "pending",
  "expires_at": "2026-07-29T05:30:00.000Z"
}
JSONGET /verifications/{id} · 200 verified
{
  "request_id": "req_01JZEXAMPLE",
  "verification_id": "ver_eyJvcGFxdWUiOiJleGFtcGxlIn0",
  "status": "verified",
  "expires_at": "2026-07-29T05:30:00.000Z"
}
JSONPOST /real-persons · 409 pending
{
  "error": {
    "code": "verification_pending",
    "message": "The represented person has not completed verification.",
    "request_id": "req_01JZEXAMPLE",
    "retryable": true
  }
}
JSONGET or POST · 410 expired
{
  "error": {
    "code": "verification_expired",
    "message": "The verification session expired. Create a new session.",
    "request_id": "req_01JZEXAMPLE",
    "retryable": false
  }
}
JSONPOST /real-persons · 202
{
  "request_id": "req_01JZEXAMPLE",
  "id": "ast_eyJvcGFxdWUiOiJleGFtcGxlIn0",
  "object": "seedance.asset",
  "kind": "real_person",
  "name": "presenter-a",
  "status": "Processing",
  "uri": "asset://asset-20260729-example"
}

Callback de verificación

HTTP
GET https://customer.example.com/seedance/verified
	  ?verification_id=ver_eyJvcGFxdWUiOiJleGFtcGxlIn0
  &result_code=10000

result_code=10000 indica que terminó el flujo H5 oficial. Usa el verification_id de Location del callback para los GET y POST posteriores: un GET pending devuelve HTTP 200, un POST prematuro devuelve HTTP 409 y un ID caducado devuelve HTTP 410. El callback no expone BytedToken.

Idiomas de la página oficial de verificación

La documentación oficial solo enumera lng=zh, lng=en y lng=zh-Hant; el valor predeterminado es zh. Esta API aplica language al enlace devuelto.

Mapeo recomendado: zh→zh, en→en, ru/ja/ko/es→en. El chino tradicional puede usar zh-Hant. No se documentan páginas oficiales en español, ruso, japonés o coreano.

Text
zh → lng=zh
en → lng=en
ru / ja / ko / es → lng=en
Traditional Chinese → lng=zh-Hant

Ejemplos de código

Node.jsJavaScript · Node.js
const headers = {
  Authorization: `Bearer ${process.env.LAOZHANG_API_KEY}`,
  "Content-Type": "application/json",
};

const begin = await fetch("https://yingtu.ai/api/seedance-assets/real-persons/verifications", {
  method: "POST",
  headers,
  body: JSON.stringify({
    callback_url: "https://customer.example.com/seedance/verified",
    language: "en",
  }),
});

if (!begin.ok) throw new Error(await begin.text());
const session = await begin.json();
const verificationUrl = session.verification_url;
// Deliver verificationUrl only to the represented person's authenticated UI.
// Do not log or persist this short-lived URL.

// After the represented person finishes the official H5 flow:
const callbackVerificationId =
  "<verification_id received at your callback URL>";
const verified = await fetch(
  `https://yingtu.ai/api/seedance-assets/real-persons/verifications/${callbackVerificationId}`,
  { headers: { Authorization: headers.Authorization } },
).then((response) => response.json());

if (verified.status === "verified") {
  const asset = await fetch("https://yingtu.ai/api/seedance-assets/real-persons", {
    method: "POST",
    headers,
    body: JSON.stringify({
      verification_id: callbackVerificationId,
      image_url: "https://cdn.example.com/presenter.webp",
      name: "presenter-a",
    }),
  }).then((response) => response.json());
  console.log(asset);
}
PythonPython · requests
import os
import requests

endpoint = "https://yingtu.ai/api/seedance-assets/real-persons"
verification_endpoint = f"{endpoint}/verifications"
headers = {"Authorization": f"Bearer {os.environ['LAOZHANG_API_KEY']}"}

session = requests.post(
    verification_endpoint,
    headers=headers,
    json={
        "callback_url": "https://customer.example.com/seedance/verified",
        "language": "en",
    },
    timeout=30,
)
session.raise_for_status()
verification = session.json()
verification_url = verification["verification_url"]
# Deliver verification_url only to the represented person's authenticated UI.
# Do not log or persist this short-lived URL.

# Run this after the represented person completes the official H5 flow.
callback_verification_id = "<verification_id received at your callback URL>"
status = requests.get(
    f"{verification_endpoint}/{callback_verification_id}",
    headers=headers,
    timeout=30,
)
status.raise_for_status()

if status.json()["status"] == "verified":
    asset = requests.post(
        endpoint,
        headers=headers,
        json={
            "verification_id": callback_verification_id,
            "image_url": "https://cdn.example.com/presenter.webp",
            "name": "presenter-a",
        },
        timeout=60,
    )
    asset.raise_for_status()
    print(asset.json())

Consultar estado del recurso

Shell
curl --request GET \
	  --url https://yingtu.ai/api/seedance-assets/real-persons/ast_eyJvcGFxdWUiOiJleGFtcGxlIn0 \
	  --header "Authorization: Bearer $LAOZHANG_API_KEY"
HTTPRespuesta de estado
HTTP/1.1 200 OK
Content-Type: application/json

{
	  "request_id": "req_01JZEXAMPLE",
	  "id": "ast_eyJvcGFxdWUiOiJleGFtcGxlIn0",
  "object": "seedance.asset",
  "kind": "real_person",
  "status": "Active",
  "uri": "asset://asset-20260729-example",
	  "created_at": "2026-07-29T05:00:00Z",
	  "updated_at": "2026-07-29T05:01:00Z"
}
JSONFailed · HTTP 200
{
  "request_id": "req_01JZEXAMPLE",
  "id": "ast_eyJvcGFxdWUiOiJleGFtcGxlIn0",
  "object": "seedance.asset",
  "kind": "real_person",
  "status": "Failed",
  "uri": "asset://asset-20260729-example",
  "failure": {
    "code": "InvalidImage",
    "message": "The image did not pass upstream validation."
  }
}

Errores

Estado HTTPCódigo de errorDescripciónReintentable
400invalid_requestEl cuerpo, un campo o un valor no son válidos.No
401invalid_api_keyLa API Key falta, no es válida o está deshabilitada.No
403resource_not_ownedLa verificación o el recurso no pertenece a esta API Key, o el ID público no es válido.No
403capability_unavailableLa cuenta de servicio no tiene habilitados los recursos privados de personas.No
409verification_pendingSolo lo devuelve POST /real-persons mientras la verificación está pending; consultar el estado por GET devuelve HTTP 200 con status=pending.Sí
410verification_expiredUn GET del estado o POST /real-persons usó un verification_id que superó los 30 minutos de vigencia.No
413payload_too_largeEl cuerpo JSON supera los 16 KB.No
415unsupported_media_typeLa solicitud POST no usa application/json.No
429rate_limit_exceededLa API Key alcanzó su límite de solicitudes.Sí
500internal_errorEl servicio no pudo completar la solicitud.No
502upstream_errorEl servicio de recursos o verificación devolvió un error.Según retryable
503authentication_unavailableLa validación de la API Key no está disponible temporalmente.Sí
503service_unavailableLa configuración del servidor de la API de recursos no está disponible temporalmente.Sí
JSONError object
{
  "error": {
    "code": "invalid_request",
	    "message": "image_url is required.",
    "request_id": "req_01JZEXAMPLE",
    "retryable": false
  }
}

Límites y seguimiento

Cada API Key admite hasta 12 solicitudes POST por hora, sumando todos los endpoints e incluidas las rechazadas; las consultas GET no cuentan. Los derechos del proveedor pueden añadir límites. Al superar el límite se devuelve 429 con Retry-After en segundos.

Todas las respuestas incluyen request_id. Inclúyelo al contactar con soporte, pero nunca envíes la API Key completa.

Text
X-RateLimit-Limit: <limit>
X-RateLimit-Remaining: <remaining>
X-RateLimit-Reset: <unix-seconds>
Retry-After: <seconds>