# TRELLIS.2 API

> TRELLIS.2 by Microsoft generates a textured 3D model (GLB with PBR materials) from a single image.

Source: https://www.sandbase.ai/models/trellis/trellis-2
API reference: https://www.sandbase.ai/models/trellis/trellis-2#api

## Facts

- Provider: trellis
- Type: Image model
- Model ID: `trellis/trellis-2`
- Price: From $0.30 per run
- Capabilities: image to 3d
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "trellis/trellis-2",
  "image": "https://static.sandbase.ai/examples/trellis/trellis-2/input_image_0.png",
  "remesh": true,
  "resolution": 1024,
  "texture_size": 2048,
  "decimation_target": 500000
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call TRELLIS.2 through SandBase?

Create a SandBase API key, then send requests with the model ID "trellis/trellis-2" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate trellis account?

No. One SandBase API key and balance gives you access to TRELLIS.2 and the other models in the catalog; you do not need to sign up with trellis separately.

## README

### TRELLIS.2
TRELLIS.2 by Microsoft generates a textured 3D model (GLB with PBR materials) from a single image.
#### Fields
| Field | Type | Default | Notes |
|---|---|---|---|
| `image` | image URL, required | — | Image of the object to convert to 3D. |
| `resolution` | `512` / `1024` / `1536` | `1024` | Generation resolution. Higher is slower and more detailed, and changes the price. |
| `texture_size` | `1024` / `2048` / `4096` | `2048` | Resolution of the baked texture image. Higher values keep finer surface detail but produce larger files. |
| `decimation_target` | integer 5000–2000000 | `500000` | Target number of vertices in the final mesh. Lower values give smaller files; 20k-50k suits web and mobile. |
| `remesh` | boolean | `true` | Rebuild the mesh topology for cleaner triangles. Slower, but usually better for animation or 3D printing. |
| `seed` | integer | — | Random seed for reproducible results. |
#### Output
- `url`: Main 3D file (GLB unless another export format is selected).
#### Billing
$0.30 per request with default settings. Price by option (other settings at default):
| Option | Price |
|---|---|
| resolution = 512 | $0.25 |
| resolution = 1024 | $0.30 |
| resolution = 1536 | $0.40 |
| texture_size = 1024 | $0.30 |
| texture_size = 2048 | $0.30 |
| texture_size = 4096 | $0.30 |
Failed runs are not charged.
#### Also on SandBase
Other trellis 3D endpoints: `trellis/trellis`, `trellis/trellis-2/retexture`, `trellis/trellis/multi`.
