# Image to 3D API

One textured 3D model (GLB with PBR materials) from one picture of one object.

Tool id `image-to-3d` on the REST API (`POST https://3dvalley.com/api/v1/jobs`); MCP tool `generate_model` on https://3dvalley.com/mcp. Paid in credits (1 credit = $0.01), taken when the job starts and given back if it fails. The general rules (keys, idempotency, waiting, webhooks) are in [the API docs](https://3dvalley.com/docs/api).

The free CC0 library holds thousands of models: `GET /api/v1/assets?q=barrel` (MCP: `search_assets`) before paying for one.

## Models and prices

| Model | Name | Price | Time | What it is |
|---|---|---|---|---|
| `trellis-2` (default) | TRELLIS.2 Standard | 5 credits | about 60 s | A detailed, textured mesh with PBR materials. The strongest open 3D model. |
| `trellis-2-pro` | TRELLIS.2 Pro | 15 credits | about 110 s | The same model at its highest settings: the finest geometry it can make, a million triangles and 4K PBR textures. |
| `hunyuan-3d-3-1-pro` | Hunyuan3D 3.1 Pro | 90 credits | about 220 s | Tencent's newest model at full quality: clean, closed meshes that print well, with fine geometry and sharp PBR materials. |
| `tripo-3-1` | Tripo 3.1 Standard | 50 credits | about 125 s | Clean, game-ready topology and detailed PBR textures. |
| `tripo-3-1-detailed` | Tripo 3.1 Detailed | 100 credits | about 240 s | The same model at its detailed settings: finer geometry and sharper textures, for a longer wait. |

## Input

| Field | Required | |
|---|---|---|
| `image` | yes | A picture (PNG, JPEG or WebP) as an https URL, a data: URI, an upload id (upl_...) or an earlier job's picture (job_...). |

## Options

| Option | Type | Values | |
|---|---|---|---|
| `seed` | integer | from 0 to 2147483647 | Fixes the randomness, so the same input makes the same result. |
| `max_faces` | integer | from 5000 to 1000000 | The most triangles the model may have, made by the model itself at no extra cost: 5,000 to 20,000 for a game or the web, 50,000 to 100,000 for a detailed prop. Without it: 200,000 (trellis-2), 1,000,000 (trellis-2-pro) or the model's own choice. |

## Output

Files: `glb`.

## Example

```
curl -X POST https://3dvalley.com/api/v1/jobs \
  -H "Authorization: Bearer $THREEDVALLEY_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=50" \
  -H "Content-Type: application/json" \
  -d '{"tool":"image-to-3d","input":{"image":"https://example.com/chest.png"},"options":{"max_faces":20000}}'
```

From an MCP client:

```
generate_model({"image":"https://example.com/chest.png","max_faces":20000})
```

## Limits

- `max_image_bytes`: 10,485,760
- `max_mesh_bytes`: 62,914,560
