API documentation
Generate 3D models from images or text, and auto-rig GLB models, using the same engine that powers the to3D studio. Authenticate REST requests with an API key from your dashboard. Usage is billed from your account balance — top up on the billing page.
Authentication
Send your key in the x-api-key header. Keys are account-scoped; anyone holding a key can spend that account's balance, so keep it secret and revoke leaked keys immediately.
curl https://api.to3d.app/api/trellis/tasks \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"task_type":"image-to-3d","input":{"image":"https://example.com/photo.png"}}'Pricing
| Endpoint | Task | Price per task |
|---|---|---|
| /api/trellis/tasks | image-to-3d · text-to-3d | $0.04 |
| /api/meshy/tasks | image-to-3d, textured 2k | $0.72 |
| /api/meshy/tasks | text-to-3d preview | $0.48 |
| /api/skin_tokens/tasks | rig | $0.30 |
The charge is reserved when a task is accepted and refunded automatically if the task fails or is cancelled before completion.
3D generation — Trellis
POST /api/trellis/tasks
Create a generation task. Returns 202 with the task object.
{
"task_type": "image-to-3d", // or "text-to-3d"
"input": {
"image": "https://…/photo.png", // image-to-3d: URL or base64; PNG/JPG/GIF, up to 128 MB
"prompt": "a red vintage car", // text-to-3d
"seed": 42, // optional, default random
"ss_sampling_steps": 12, // optional advanced knobs
"slat_sampling_steps": 12,
"ss_guidance_strength": 7.5,
"slat_guidance_strength": 3.0
}
}Response (same shape for every task endpoint):
{
"id": "0b56a3fe-…",
"status": "pending", // pending → processing → succeeded | failed | canceled
"task_type": "image-to-3d",
"input": { … },
"output": { // present once status = succeeded
"model_file": "https://storage.to3d.app/tasks/…/model.glb",
"no_background_image": "https://…",
"combined_video": "https://…"
},
"error": { "code": "…", "message": "…" }, // present when failed
"created_at": "…", "updated_at": "…"
}GET /api/trellis/tasks/:id
Poll task status. Output files are stored permanently on our storage — the URLs do not expire.
POST /api/trellis/tasks/:id/cancel
Cancel a queued task. Tasks already completed cannot be cancelled (409).
Image and text to 3D — Meshy
Use POST /api/meshy/tasks with the same account-scoped API key. These examples create paid tasks; do not run them just to check connectivity. You can also select Meshy in the Studio.
Image to 3D
{
"task_type": "image-to-3d",
"input": {
"image_url": "https://example.com/photo.png",
"should_texture": true,
"texture_resolution": "2k"
}
}The textured 2k image configuration above costs $0.72. Other texture settings can change the price.
Text to 3D preview
{
"task_type": "text-to-3d",
"input": {
"mode": "preview",
"prompt": "A small stylized robot with a square head"
}
}A text preview costs $0.48. It is not a textured refine result. Refinement is a separate paid task using mode: refine and preview_task_id from a successful preview owned by the same account.
Read the result
Poll GET /api/meshy/tasks/:id using the same API key until the task reaches a terminal status. Do not repeat the creation request to poll. Processing time varies; a successful response to creation is not a completed model.
Supported output format is GLB. Humanoid rigging is a separate operation, not included in the Meshy generation price. Review account-scoped task history on the API usage page.
Auto-rigging — Skin Tokens
POST /api/skin_tokens/tasks
Rig a humanoid GLB model with a skeleton. Typical processing takes several minutes.
{
"task_type": "rig",
"input": {
"model": "https://…/model.glb", // GLB URL or base64
"bone_names": "mixamo", // "original" | "mixamo" | "ue5"
"seed": 42 // optional
}
}GET /api/skin_tokens/tasks/:id and POST /api/skin_tokens/tasks/:id/cancel work the same way as the Trellis endpoints. The rigged model is returned as output.model_file.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_input | Malformed body, unsupported task_type, or bad parameters |
| 401 | — | Missing or invalid x-api-key |
| 402 | refund_debt_outstanding | The account owes a refunded balance — top up first |
| 404 | task_not_found | Unknown task id (tasks are visible only to their own account) |
| 409 | insufficient_credits | Balance too low — top up on the billing page |
| 409 | task_not_cancellable | Task already finished |
| 413 | invalid_input | Request body over 180 MB |
| 503 | unavailable / retryable errors | Transient upstream issue — retry with backoff |
Quickstart
# 1. create a task
TASK=$(curl -s https://api.to3d.app/api/trellis/tasks \
-H "x-api-key: $TO3D_KEY" -H "Content-Type: application/json" \
-d '{"task_type":"image-to-3d","input":{"image":"https://example.com/photo.png"}}' \
| python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
# 2. poll until it settles (~80 s for mesh, +30 s if rigging)
watch -n 5 "curl -s https://api.to3d.app/api/trellis/tasks/$TASK -H 'x-api-key: $TO3D_KEY' \
| python3 -m json.tool | grep -E 'status|model_file'"MCP
Connect an MCP-capable client that supports remote HTTP servers and OAuth to https://mcp.to3d.app/v2/mcp. Authorize the connection in your browser through TO3D's WorkOS AuthKit sign-in. Generation is billed to the connected TO3D account; signing in does not submit a generation task.
The server's OAuth discovery metadata identifies this endpoint as the resource and https://orderly-singer-60.authkit.app as its authorization server, with openid and email scopes.
Claude Code
claude mcp add --transport http to3d https://mcp.to3d.app/v2/mcpRun this in your project directory. Start claude, open /mcp, select to3d, and choose Authenticate. Complete the AuthKit login and authorization in the browser, then return to Claude Code. Ask it to show TO3D's tools before requesting a model.
Other MCP-capable clients
For a client that accepts an mcpServers configuration, use the following URL entry and its OAuth sign-in action. Cursor documents this format in .cursor/mcp.json for a project or ~/.cursor/mcp.json for all projects. OAuth sign-in with Cursor has not been verified against TO3D.
{
"mcpServers": {
"to3d": {
"url": "https://mcp.to3d.app/v2/mcp"
}
}
}CLI
Use Bash, curl, and jq to submit an image, poll its task, and download the GLB from a build script. Export TO3D_KEY from your API key secret and set TO3D_IMAGE_URL to a publicly reachable PNG, JPEG, or GIF URL. The script creates one paid task and saves model.glb, or the path in TO3D_OUTPUT.
#!/usr/bin/env bash
set -euo pipefail
: "${TO3D_KEY:?set TO3D_KEY to a TO3D API key}"
: "${TO3D_IMAGE_URL:?set TO3D_IMAGE_URL to a public image URL}"
OUTPUT="${TO3D_OUTPUT:-model.glb}"
# Pass the key through stdin.
api() {
printf 'x-api-key: %s\n' "$TO3D_KEY" | curl --header @- \
--fail-with-body --silent --show-error --connect-timeout 10 --max-time 60 "$@"
}
# Submit once; polling or downloads never create another task.
PAYLOAD=$(jq -cn --arg image "$TO3D_IMAGE_URL" \
'{task_type: "image-to-3d", input: {image: $image}}')
TASK=$(api "https://api.to3d.app/api/trellis/tasks" \
-H 'Content-Type: application/json' --data "$PAYLOAD" \
| jq -er '.id | select(type == "string" and length > 0)')
printf 'Task: %s\n' "$TASK"
MODEL_URL=''
for ((attempt = 0; attempt < 120; attempt++)); do
STATUS_JSON=$(api "https://api.to3d.app/api/trellis/tasks/$TASK")
STATUS=$(jq -er '.status' <<< "$STATUS_JSON")
case "$STATUS" in
succeeded)
MODEL_URL=$(jq -er '.output.model_file | select(type == "string" and startswith("https://"))' <<< "$STATUS_JSON")
break
;;
failed|canceled)
jq '{id, status, error}' <<< "$STATUS_JSON" >&2
exit 1
;;
pending|processing)
sleep 5
;;
*)
printf 'Unexpected status for %s: %s\n' "$TASK" "$STATUS" >&2
exit 1
;;
esac
done
[ -n "$MODEL_URL" ] || {
printf 'Polling timed out. Check task %s again; do not resubmit.\n' "$TASK" >&2
exit 1
}
# The result URL needs no API key.
curl --fail --silent --show-error --location \
--connect-timeout 10 --max-time 120 "$MODEL_URL" --output "$OUTPUT"
[ "$(head -c 4 "$OUTPUT")" = 'glTF' ] || { printf 'Invalid GLB download\n' >&2; exit 1; }
printf 'GLB: %s (%s bytes)\n' "$OUTPUT" "$(wc -c < "$OUTPUT")"Polling stops after 120 checks, five seconds apart. If a request fails or polling times out, check the printed task ID with GET /api/trellis/tasks/:id. Re-running the whole script submits another paid task.
Guides
Practical workflows for turning one image into a GLB, checking its structure, and connecting an MCP client.
- Image to GLB with curl
- What is inside a TO3D GLB
- Connect an MCP client to TO3D
- Humanoid rigging, explained
Need help integrating? Contact support.