Two tiny, dependency-light shell scripts that drive the Tripo generative API from the command line:
tripo-generate.shturns a text prompt into a 3D model and downloads the GLB.tripo-image.shturns a text prompt into a 2D image and downloads the PNG.
Both check your credit balance first and refuse to run at zero, so a misconfigured key never silently burns credits. Long jobs are polled with automatic retries, so a single network blip does not kill the run.
The official flow is a multi-step REST dance: create a task, poll it, then fetch the output URL. These scripts collapse that into one command, add the guard rails (balance check, verbatim-key validation, resilient polling), and bake in the model-version and quality knobs that actually produce good output.
export TRIPO_API_KEY='tsk_...' # single-quote the WHOLE token; never commit itTripo keys contain
-and sometimes_and are about 47 characters. If you copy one out of a file, usegrep -oE 'tsk_[A-Za-z0-9_-]+'. A truncated key fails with API code 1002 ("Authentication failed"), which looks like an auth problem but is usually just a clipped key.
./tripo-generate.sh "a sleek fighter spaceship" out/ship.glbEnvironment knobs:
| Variable | Default | Effect |
|---|---|---|
TRIPO_TEXTURE |
true |
false gives a cheaper geometry-only mesh (useful when you recolour it yourself) |
TRIPO_MODEL_VERSION |
v3.0-20250812 |
Newest full-quality model. Turbo-v1.0-20250506 is the fast, cheap one |
TRIPO_TEXTURE_QUALITY |
detailed |
standard or detailed |
TRIPO_GEOMETRY_QUALITY |
detailed |
standard or detailed |
A textured run costs roughly 20 credits; geometry-only roughly 10.
./tripo-image.sh "a nebula backdrop, deep blues" out.png # basic, ~5 credits
TRIPO_MODEL=gpt_image_2 ./tripo-image.sh "a nebula backdrop" out.png # high-end, ~10 credits| Variable | Default | Effect |
|---|---|---|
TRIPO_MODEL |
(unset) | Unset uses the basic text_to_image model. Set it to pick a high-end model: gpt_image_2, gpt_image_1.5, midjourney, gemini_3_pro_image_preview, flux.1_kontext_pro, flux.1_dev, gpt_4o, and others |
TRIPO_NEG |
(unset) | Optional negative prompt |
Models from Tripo are typically around 300k triangles with 2K textures, which is heavy for a real-time engine or a web build. To decimate the mesh and shrink the textures, see the companion tool glb-slim.
MIT. See LICENSE.
Not affiliated with Tripo. "Tripo" is the property of its owner; this project just talks to its public API.