3D models
A 3D model takes a minute or two to make, so it is a job, like a video: you create it, poll it until it is done, then download the file. Every 3D model works this way, through the same three calls:
| Step | Call | Returns |
|---|---|---|
| Create | POST /v1/3d/generations | The job, with its id and status queued |
| Poll | GET /v1/3d/generations/{generation_id} | The job's current status; once completed, a model_url |
| Download | GET /v1/3d/generations/{generation_id}/content | The model file (GLB) |
# 1. Create: a textured model from a prompt
curl https://api.oceantoken.ai/v1/3d/generations \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"model": "tripo/h3.1", "prompt": "A small wooden treasure chest with brass corners"}'
# 2. Poll until "status" is "completed" (or "failed")
curl https://api.oceantoken.ai/v1/3d/generations/$ID \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY"
# 3. Download the GLB file
curl -L https://api.oceantoken.ai/v1/3d/generations/$ID/content \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY" -o chest.glb
Poll every 10 to 15 seconds. Send an Idempotency-Key with the create call, so a retry after a network error cannot start, and charge, a second job.
The request
Give one of prompt, image_url or image_urls:
| Field | What it does |
|---|---|
model | A 3D model's ID: tripo/h3.1 or tripo/p1. Any other model is refused with 400. |
prompt | Text to 3D: what to make, up to 1,024 characters. |
image_url | Image to 3D: one picture of the object, a public https:// URL. |
image_urls | Two to four views of the same object, in the order front, left, back, right. |
negative_prompt | What to leave out, up to 255 characters. |
texture | true (the default) paints the model; false returns plain geometry, which costs less. |
pbr | true (the default) adds physically based materials; it needs a texture, so pbr: true turns texture on. |
texture_quality | standard (the default), detailed or extreme. |
geometry_quality | standard or detailed (tripo/h3.1 only). |
face_limit | The most faces the mesh may have, a whole number, for a lighter model. |
quad | true for a quad mesh instead of triangles (tripo/h3.1 only). |
smart_low_poly | true for a clean low-poly mesh (tripo/h3.1 only). |
seed | A whole number, to make the same model again from the same request. |
A value a model does not take is refused with 400 invalid_request before anything runs or is charged, and the message says what it takes.
The job
{
"id": "otj_…",
"object": "3d_generation",
"model": "tripo/h3.1",
"status": "completed",
"created_at": 1763800000,
"model_url": "https://…/chest.glb"
}
A job moves through queued → in_progress → completed or failed. 3D jobs share your account's limit on jobs running at the same time with video and images: a job beyond it stays queued with a queue_position and starts by itself in order, POST /v1/videos/{id}/cancel cancels it while it is still queued (not charged), and one that has not started within 30 minutes fails with timeout, not charged. See Jobs running at the same time. model_url is set once the job is completed; the /content call returns the same file. A failed job carries an error with a code and a message (for example moderation, when the prompt or image is refused), and is not charged.
Only the API key's owner (or an admin of their organization) can read a job; any other id answers 404.
Cost
You pay per 3D model, by how it is made and whether it is textured. These are the list prices; each tier pays its share of them, and the model's page shows the current figures.
| Model | From text | From one image | From 2 to 4 views |
|---|---|---|---|
tripo/h3.1, untextured / textured | $0.10 / $0.20 | $0.20 / $0.30 | $0.20 / $0.30 |
tripo/p1, untextured / textured | $0.30 / $0.40 | $0.40 / $0.50 | $0.40 / $0.50 |
A job is charged once, when it completes. A failed or refused job is not charged.