MCPcopy Index your code
hub / github.com/VAST-AI-Research/tripo-python-sdk

github.com/VAST-AI-Research/tripo-python-sdk @v0.4.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.2 ↗ · + Follow
159 symbols 573 edges 19 files 145 documented · 91%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Tripo3d Python SDK

The Tripo3d Python SDK is the official Python client library for the Tripo 3D Generation API. With this SDK, you can easily generate high-quality 3D models.

Features

  • Text-to-3D model generation
  • Image-to-3D model generation
  • Multi-view to 3D model generation
  • Text-to-image and advanced image generation (multi-model, multi-reference, templates)
  • Multiview image generation and editing
  • One-shot model animation (auto rig + retarget)
  • External model import (GLB / OBJ / FBX / STL)
  • Mesh editing including mesh segmentation, mesh completion and smart lowpoly
  • Model conversion and stylization
  • Rigging and retarget
  • Asynchronous API support
  • Complete type hints

Installation

pip install tripo3d

Quick Start

Initialization

import asyncio
from tripo3d import TripoClient

async def main():
    # Initialize client with API key
    client = TripoClient(api_key="your_api_key")

    # Or read from environment variable
    # export TRIPO_API_KEY=your_api_key
    # client = TripoClient()

    # Use the client
    # ...

    # Close client connection
    await client.close()

# Run async function
asyncio.run(main())

Text to 3D Model

import asyncio
from tripo3d import TripoClient

async def text_to_model_example():
    async with TripoClient() as client:
        # Create text to 3D model task
        task_id = await client.text_to_model(
            prompt="A cute cat",
            negative_prompt="low quality, blurry",
        )

        print(f"Task ID: {task_id}")

        # Wait for task completion
        task = await client.wait_for_task(task_id)

        if task.status == TaskStatus.SUCCESS:
            print(f"Task completed successfully!")

            # Download model files
            downloaded_files = await client.download_task_models(task, "./output")

            # Print downloaded file paths
            for model_type, file_path in downloaded_files.items():
                if file_path:
                    print(f"Downloaded {model_type}: {file_path}")

asyncio.run(text_to_model_example())

Image to 3D Model

import asyncio
from tripo3d import TripoClient

async def image_to_model_example():
    async with TripoClient() as client:
        # Create image to 3D model task
        task_id = await client.image_to_model(
            image="path/to/your/image.jpg",
        )

        print(f"Task ID: {task_id}")

        # Wait for task completion and show progress
        task = await client.wait_for_task(task_id, verbose=True)

        if task.status == TaskStatus.SUCCESS:
            print(f"Task completed successfully!")

            # Download model files
            downloaded_files = await client.download_task_models(task, "./output")

            # Print downloaded file paths
            for model_type, file_path in downloaded_files.items():
                if file_path:
                    print(f"Downloaded {model_type}: {file_path}")

asyncio.run(image_to_model_example())

Multi-view to 3D Model

import asyncio
from tripo3d import TripoClient

async def multiview_to_model_example():
    async with TripoClient() as client:
        # Create multi-view to 3D model task
        task_id = await client.multiview_to_model(
            images=[
                "path/to/front.jpg",   # Front view (required)
                "path/to/back.jpg",    # Back view (optional)
                "path/to/left.jpg",    # Left view (optional)
                "path/to/right.jpg"    # Right view (optional)
            ],
        )

        print(f"Task ID: {task_id}")

        # Wait for task completion and show progress
        task = await client.wait_for_task(task_id, verbose=True)

        if task.status == TaskStatus.SUCCESS:
            print(f"Task completed successfully!")

            # Download model files
            downloaded_files = await client.download_task_models(task, "./output")

            # Print downloaded file paths
            for model_type, file_path in downloaded_files.items():
                if file_path:
                    print(f"Downloaded {model_type}: {file_path}")

asyncio.run(multiview_to_model_example())

Check Account Balance

import asyncio
from tripo3d import TripoClient

async def check_balance():
    async with TripoClient() as client:
        balance = await client.get_balance()
        print(f"Available balance: {balance.balance}")
        print(f"Frozen amount: {balance.frozen}")

asyncio.run(check_balance())

Advanced Usage

For more advanced usage examples, check out the examples directory.

API Reference

The complete API documentation can be found here.

License

MIT

Core symbols most depended-on inside this repo

create_task
called by 18
tripo3d/client.py
_get_passed_args
called by 14
tripo3d/client.py
_add_optional_params
called by 14
tripo3d/client.py
wait_for_task
called by 9
tripo3d/client.py
from_dict
called by 8
tripo3d/models.py
_request
called by 8
tripo3d/client_impl/base_client.py
_image_to_file_content
called by 7
tripo3d/client.py
_ensure_session
called by 7
tripo3d/client_impl/aiohttp_client_impl.py

Shape

Method 126
Class 23
Function 10

Languages

Python100%

Modules by API surface

tripo3d/client.py41 symbols
tests/test_client.py39 symbols
tripo3d/client_impl/legacy_client_impl.py15 symbols
tripo3d/models.py12 symbols
tests/test_models.py11 symbols
tripo3d/client_impl/aiohttp_client_impl.py9 symbols
tripo3d/geo_utils.py8 symbols
tripo3d/client_impl/base_client.py8 symbols
tests/test_exceptions.py5 symbols
tripo3d/exceptions.py4 symbols
examples/retarget_animation.py2 symbols
tripo3d/__init__.py1 symbols

For agents

$ claude mcp add tripo-python-sdk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact