3D models
The key you use for text, images and video also makes 3D models, from the same balance, with models from Meshy, Tripo, Rodin (Hyper3D), Seed3D (ByteDance), Hitem3D, Hunyuan3D (Tencent) and TRELLIS (Microsoft). Each model's page shows its price and a working request.
| You want | Route | What you send |
|---|---|---|
| A 3D model from words | POST /v1/3d/generations |
prompt |
| A 3D model from a picture | POST /v1/3d/generations |
image_url |
| A 3D model from several views of one object | POST /v1/3d/generations |
images |
| A change to a 3D model you have: new textures, fewer polygons, a skeleton for animation, another file type | POST /v1/3d/generations |
model_url (and a prompt for new textures) |
A 3D model takes a minute or more, so it is a job, like a video: start it, check on it, download the file.
What you pay
Each 3D model has one price per model made (its pricing unit is job), whatever
you ask it to make. Ask for the price first, for free, with "validate": true or
POST /v1/quote (see Get the price first), and send
"max_cost" (US dollars) so a job that could cost more is refused before anything is
charged.
When a job starts, what it can cost is held from your balance (max_cost_usd) and
the rest comes back when it ends. The hold and the bill work as they do for a video:
see Make a video. A job that failed, was canceled or
expired costs nothing.
List the 3D models
curl -H "Authorization: Bearer $MARTLLM_API_KEY" \
"https://api.martllm.com/v1/models?type=3d"
Each entry has "type": "3d", "endpoints": ["/v1/3d/generations"] and its
pricing. What a model does is in input_modalities and media_options.features:
media_options.features |
input_modalities |
It makes |
|---|---|---|
text-to-3d |
["text"] |
a 3D model from words |
image-to-3d |
["image"] or ["text", "image"] |
a 3D model from one picture |
multi-image-to-3d |
["image"] or ["text", "image"] |
a 3D model from several views of the same object |
3d-tool |
includes "3d" |
a changed copy of a 3D model you send |
Add ¶meters=1 to get each model's request as a JSON Schema, or ask for one
model with GET /v1/models/<model id>: its parameters list the model's own
settings (for example the number of polygons or the texture size) and the values it
takes. Send only settings it lists; a request is checked against them before anything
is charged. ?type=all lists 3D models with every other kind.
Make a 3D model from words
curl https://api.martllm.com/v1/3d/generations \
-H "Authorization: Bearer $MARTLLM_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"model": "meshy/meshy-6-text-to-3d", "prompt": "a red vintage car"}'
HTTP 202:
{
"id": "9b2e…",
"object": "media.job",
"kind": "3d",
"status": "queued",
"model": "meshy/meshy-6-text-to-3d",
"estimated_cost_usd": 1.14,
"max_cost_usd": 1.14,
"poll_url": "/v1/3d/generations/9b2e…"
}
estimated_cost_usd is the price to expect and max_cost_usd is what is held while
it runs. The Idempotency-Key header is optional: send the same request again with
the same key within 24 hours (after a dropped connection, say) and you get the same
job back, never a second one (see
Retry without paying twice).
Make a 3D model from a picture
Use a picture-to-3D model and send the picture in image_url:
curl https://api.martllm.com/v1/3d/generations \
-H "Authorization: Bearer $MARTLLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "tripo/tripo-h3-1-image-to-3d", "image_url": "https://example.com/chair.png"}'
A model made for several views of the same object (front, side, back) takes them in
images, in the order its schema gives:
-d '{"model": "<multi-view model id>",
"images": ["https://example.com/chair-front.png", "https://example.com/chair-side.png",
"https://example.com/chair-back.png"]}'
Each picture is a public https:// link or the id of a picture you uploaded to
POST /v1/files (see Upload a picture or video once).
A picture-to-3D model sent no picture is refused with 400 image_required before
anything is charged, and so is a multi-view model sent fewer views than its schema's
minItems. A model's prompt has the most characters its schema's maxLength says.
A plain background and the whole object in the frame give the best model.
Change a 3D model you have
3D tools take a model file you already have and give back a changed copy: new
textures (retexture), a cleaner or lighter mesh with fewer polygons (remesh), a
skeleton so it can be animated (rig), or the same model in another file type
(convert). Send the file in model_url: an https:// link to a GLB, FBX, OBJ or STL
file, or the id of a file you uploaded to POST /v1/files (up to 50 MB); a 3D tool
sent no model file is refused with 400 model_file_required before anything is
charged. A retexture model also takes a prompt that describes the new look, or a
picture in image_url whose look it copies (one of the two):
curl https://api.martllm.com/v1/3d/generations \
-H "Authorization: Bearer $MARTLLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "<retexture model id>", "model_url": "https://example.com/chair.glb",
"prompt": "dark walnut wood with brass legs"}'
To send a file from your computer, upload it once and put the id you get in
model_url:
curl https://api.martllm.com/v1/files \
-H "Authorization: Bearer $MARTLLM_API_KEY" \
-F [email protected]
Check on the job
Ask every 5–10 seconds, or send callback_url with the job and we tell you when it
ends (see Callbacks; the message is signed the same way as for
a video).
curl -H "Authorization: Bearer $MARTLLM_API_KEY" \
https://api.martllm.com/v1/3d/generations/<job id>
HTTP 202 while the job runs, HTTP 200 once it ends:
{
"id": "9b2e…",
"status": "succeeded",
"results": [{ "artifact_index": 0, "url": "https://api.martllm.com/v1/media/artifacts/9b2e…/0",
"content_type": "model/gltf-binary" }],
"usage": { "cost_usd": 1.14 }
}
status is queued, running, succeeded, failed, canceled or expired, as
for a video (see Job status). On failed, error.message
says why. usage.cost_usd is what the job cost once it is billed; until then a
succeeded job can show "cost_usd": null with "cost_pending": true for a few
seconds.
Download the file
The link needs the same key:
curl -L -o model.glb -H "Authorization: Bearer $MARTLLM_API_KEY" \
https://api.martllm.com/v1/media/artifacts/<job id>/0
Name the file by its content_type:
content_type |
File |
|---|---|
model/gltf-binary |
.glb (one file with its textures; opens in Blender, three.js and most web 3D viewers) |
model/gltf+json |
.gltf |
model/obj |
.obj |
model/stl |
.stl (for 3D printing) |
model/vnd.usdz+zip |
.usdz (Apple AR Quick Look) |
application/zip |
.zip (a model with its texture files) |
model/x-fbx |
.fbx (game engines, Maya, 3ds Max) |
model/3mf |
.3mf (a multi-color 3D print file) |
application/x-ply |
.ply (Gaussian splats) |
A file whose link names none of these is served with the type the model gave it.
A job can make more than one file: save every entry of results. Download soon after
the job ends: files are kept for about 3 hours, then the link answers
404 artifact_expired.
Get the price first
Add "validate": true to the same request. Nothing is made or charged, and the
answer says what it costs:
curl https://api.martllm.com/v1/3d/generations \
-H "Authorization: Bearer $MARTLLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "meshy/meshy-6-text-to-3d", "prompt": "a red vintage car", "validate": true}'
{ "object": "quote", "model": "meshy/meshy-6-text-to-3d", "kind": "3d", "valid": true,
"cost_usd": 1.14, "max_cost_usd": 1.14, "unit": "job", "units": 1, "note": "Nothing was charged. …" }
POST /v1/quote takes the same body and answers cost_usd too, with a quote_id
that holds the price for 15 minutes (see
Hold a price for 15 minutes):
curl https://api.martllm.com/v1/quote \
-H "Authorization: Bearer $MARTLLM_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "meshy/meshy-6-text-to-3d", "prompt": "a red vintage car"}'
Then send the job with "max_cost" set to the price you agreed to. If it can cost
more, it is refused with 400 max_cost_too_low and nothing is charged (see
Set a ceiling). metadata tags the job in Activity and the
CSV export, as on any request.
Stop a job
curl -X DELETE -H "Authorization: Bearer $MARTLLM_API_KEY" \
https://api.martllm.com/v1/3d/generations/<job id>
We ask the seller to stop it. A job that stops ends canceled and costs nothing; a
model that was already made ends succeeded and is billed.
Errors
3D jobs answer the same errors as video jobs (see Errors). The ones you are most likely to meet:
| HTTP | code | meaning |
|---|---|---|
| 400 | wrong_endpoint |
the model is not a 3D model, or a 3D model was sent to another route; the message names the right one. Nothing is charged |
| 400 | invalid_request |
the request is wrong, for example a setting the model does not take; the message says what to fix. Nothing is charged |
| 400 | image_required |
a picture-to-3D model (or a tool that works from a picture) was sent no picture, or too few views. Nothing is charged |
| 400 | model_file_required |
a 3D tool was sent no model_url. Nothing is charged |
| 400 | max_cost_too_low |
it can cost more than your max_cost; nothing was charged |
| 402 | insufficient_credits |
your balance can't cover the job; the message says how much it needs |
| 404 | model_not_found / not_found |
no such model, or no such job on your account |
| 404 | artifact_expired |
the file is no longer kept; download files soon after the job ends |
| 503 | no_available_provider |
no seller can make it right now; try again in a minute or pick another model |