1. Create the image task
Set an API key and a public image URL, then submit one task. The response is asynchronous; keep the task ID and do not create a second task while the first one is processing.
export TO3D_KEY='YOUR_API_KEY'
export TO3D_IMAGE_URL='https://example.com/character.png'
TASK_JSON=$(curl --fail-with-body --silent --show-error \
https://api.to3d.app/api/trellis/tasks \
-H "x-api-key: $TO3D_KEY" \
-H 'Content-Type: application/json' \
-d "$(jq -cn --arg image "$TO3D_IMAGE_URL" \
'{task_type:"image-to-3d",input:{image:$image}}')")
TASK_ID=$(jq -er '.id' <<<"$TASK_JSON")
printf 'Task: %s\n' "$TASK_ID"2. Poll the task and download the GLB
Poll the same task ID until it reaches `succeeded`, `failed`, or `canceled`. When `status` is `succeeded`, download the URL in `.output.model_file`.
curl --fail-with-body --silent --show-error \
"https://api.to3d.app/api/trellis/tasks/$TASK_ID" \
-H "x-api-key: $TO3D_KEY" | jq '{id,status,output,error}'
MODEL_URL=$(curl --fail-with-body --silent --show-error \
"https://api.to3d.app/api/trellis/tasks/$TASK_ID" \
-H "x-api-key: $TO3D_KEY" | jq -er '.output.model_file')
curl --fail --location --silent --show-error "$MODEL_URL" --output character.glb
[ "$(head -c 4 character.glb)" = 'glTF' ]3. Request a separate humanoid rig
Host `character.glb` at a URL that the API can reach, then submit the second task. Choose `mixamo` if that is the naming convention you want to inspect first. Poll `https://api.to3d.app/api/skin_tokens/tasks/$RIG_ID` and download its `output.model_file` after success.
export TO3D_MODEL_URL='https://example.com/character.glb'
RIG_JSON=$(curl --fail-with-body --silent --show-error \
https://api.to3d.app/api/skin_tokens/tasks \
-H "x-api-key: $TO3D_KEY" \
-H 'Content-Type: application/json' \
-d "$(jq -cn --arg model "$TO3D_MODEL_URL" \
'{task_type:"rig",input:{model:$model,bone_names:"mixamo"}}')")
RIG_ID=$(jq -er '.id' <<<"$RIG_JSON")
printf 'Rig task: %s\n' "$RIG_ID"4. Check the file in Unity
Import the downloaded GLB into the Unity package or importer used by your project. Inspect the model scale, material, skeleton mapping, bind pose, and animation clips. If Unity reports unmapped bones or an avatar that cannot be configured, adjust the rig or mapping in the project and test a simple pose. The API's `mixamo` label is a naming option; it is not a TO3D certification of Unity Humanoid retargeting.
- Keep the generated GLB, the rigged GLB, and the Unity import result as separate artifacts while you validate your own character.
Keep the sample evidence in scope
The #56 sample inspection found skeleton joints, skin weights, UVs, and an embedded PNG in each of four public GLBs. That is useful evidence for what those files contain. It is not evidence that every new input will deform well, include facial shapes, or import without cleanup.
- The four samples do not establish facial shapes, visemes, VRM export, or automatic Unity retargeting.