Skip to content

ravanova/tripo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tripo-cli

Two tiny, dependency-light shell scripts that drive the Tripo generative API from the command line:

  • tripo-generate.sh turns a text prompt into a 3D model and downloads the GLB.
  • tripo-image.sh turns 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.

Why

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.

Requirements

  • bash, curl, and jq
  • A Tripo API key. Create one in your Tripo account, then:
export TRIPO_API_KEY='tsk_...'   # single-quote the WHOLE token; never commit it

Tripo keys contain - and sometimes _ and are about 47 characters. If you copy one out of a file, use grep -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.

Usage

3D models

./tripo-generate.sh "a sleek fighter spaceship" out/ship.glb

Environment 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.

2D images

./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

Slimming the output

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.

License

MIT. See LICENSE.

Not affiliated with Tripo. "Tripo" is the property of its owner; this project just talks to its public API.

About

Tiny bash CLI for the Tripo generative API: text-to-3D (GLB) and text-to-image (PNG), with balance checks and resilient polling.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages