Skip to main content

Tripo Python Client

PyPI version

This is a Python client for the Tripo API.

Installation

pip install tripo
export TRIPO_API_KEY="your_api_key"

Usage

This first example is to get the balance.

from tripo import Client

with Client() as client:
    balance = client.get_balance()
    print(f"Balance: {balance.balance}, Frozen: {balance.frozen}")

This example is to generate a model from text.

import time
from tripo import Client

# Initialize the client
with Client() as client:
    # Create a task to generate a model from text
    success_task = client.text_to_model(
        prompt="A 3D model of a futuristic car",
        model_version="v2.0-20240919",
        texture=True,
        pbr=True
    )
    print(f"Created task with ID: {success_task.task_id}")

    # Get 3d model
    print("Waiting for the model to be ready...")
    while True:
        data = client.try_download_model(success_task.task_id)
        if data is not None:
            data.save("model.glb")
            break
        time.sleep(1)

This is the 3D model generated by the previous example.

3D Model

The next example is to generate a model from an image.

import time
from tripo import Client

# Initialize the client
with Client() as client:
    # Upload a file
    file_token = client.upload_file('path/to/your/image.jpg')
    # Or upload a byte array
    # byte_image = open('path/to/your/image.jpg', "rb").read()
    # file_token = client.upload_file(byte_image)
    print(f"Uploaded file token: {file_token.file_token}")

    # Create a task to generate a model from an image
    success_task = client.image_to_model(
        file_token=file_token,
        model_version='v1.4-20240625',
        texture=True,
        pbr=True
    )
    print(f"Created task with ID: {success_task.task_id}")

    # Get 3d model
    print("Waiting for the model to be ready...")
    while True:
        data = client.try_download_model(success_task.task_id)
        if data is not None:
            data.save("model.glb")
            break
        time.sleep(1)

Metadata

Release files for tripo 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tripo 0.2.1
File Size Uploaded Provenance
tripo-0.2.1.tar.gz 32.6 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tripo 0.2.1
File Interpreter ABI Platform
tripo-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.6 MB

Release files / tripo-0.2.1.tar.gz

Download URL tripo-0.2.1.tar.gz
Size 32.6 MB
Tags Source
SHA-256 checksum
How to use checksums
ce084db37e25d44eda148928b4ed26983ca21f276c6ffadb595123adf84d896d
BLAKE2b-256 checksum
How to use checksums
b9c5d6e826087f73c6cbff3a8bc8b5f99b66bc2f84906e0240aebc6749e44f74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Release files / tripo-0.2.1-py3-none-any.whl

Download URL tripo-0.2.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d902540ed3e8ddd2b529c98357b24b6a1ced03c6580b935e98f0a5bf24fb26a5
BLAKE2b-256 checksum
How to use checksums
b8398ee0ef44ecaa400c4b606b120ce4d3836548caa326e864b55f632c47ace7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Security for tripo 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page