> ## Documentation Index
> Fetch the complete documentation index at: https://vetta.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 3D assets

> Generate a textured 3D model from a description or photos, or build a dimensioned part or scene in code — two agent tools, one file library.

An agent makes 3D assets two ways, and they answer different questions. **Generate** when what matters is how it looks: a prop, a character, a product for a video. **Build** when what matters is its dimensions: a bracket, an enclosure, a scene laid out to the millimetre. Either way the result is a [file](/docs/capabilities/files) of kind `model`, listed under **3D** in the files library, and a GLB opens in a 3D viewer in the chat.

| | `generate_3d_model` | `build_3d` |
| - | - | - |
| Input | A description, or 1–4 photos of one object | A Python script: build123d (`cad`, millimetres) or Blender (`blender`, metres) |
| Output | A textured GLB, optionally rigged with an idle animation | STEP, STL, 3MF, GLB, OBJ or `.blend`, plus preview PNGs and checks |
| Runs | As a media job, in under a minute to over ten | In the agent's own [computer](/docs/capabilities/computer), in seconds |
| Billed | Per job, for the options used, at completion | The computer's running seconds |
| REST | [`POST /v1/media/meshes`](/docs/api/meshes) | [`POST /v1/computers/{id}/build-3d`](/docs/api/computers#build-a-3d-model) |

A generated mesh is never a spec: its size is whatever the model guessed. Anything that must fit, print or mate with another part is built.

## Generate a model

`generate_3d_model` takes `prompt` or `images` (1–4 `fil_` ids or `https` URLs), and optionally `model`, `texture` (default `true`) and `rig` (default `false`, a description only). Like `generate_video`, it does not block: the agent gets the job's handle in the same turn and is woken with the GLB's `fil_` when it finishes. It asks before it runs by default, because it spends.

```bash CLI theme={"system"}
vetta media mesh "a weathered bronze lantern, game-ready" --wait --out lantern.glb
vetta media mesh --image fil_01J... --image fil_01K... --no-texture
```

```ts SDK theme={"system"}
const job = await client.media.meshes.create({ image_urls: ["fil_01J..."] });
```

Two to four photos are read as views of the same object, which recovers the back and sides better than one. Generated models come from a photo in about a minute; from a description, rigged, they can take over ten.

## Build a model

`build_3d` runs a script in a clean Python process on the agent's computer, then checks the result and renders it. The toolchain installs on first use (about 20 seconds and 1.9 GB of disk; an agent's computer has room for it).

* **`cad`** — the script assigns `result`, a build123d shape, in millimetres. The tool reports whether it is a valid solid, whether it is watertight, its bounding box, volume and triangle count. STEP, STL and 3MF are published **only** when it is a valid, watertight solid, so a broken part never ships.
* **`blender`** — the script builds the scene with `bpy`, in metres, Z up. Use it for scenes, materials and renders, or to clean up a generated GLB. An open mesh still publishes as GLB, blend or OBJ, but never as STL or 3MF.

```python theme={"system"}
from build123d import *

with BuildPart() as plate:
    Box(60, 40, 4)
    with Locations((-24, -14), (24, -14), (-24, 14), (24, 14)):
        Hole(1.6)
result = plate.part
```

```bash theme={"system"}
vetta computer build-3d cmp_01J... plate.py --engine cad --export step,stl --views iso,top --out ./plate
```

The answer carries `ok`, the published `files`, the `previews` (which the agent also sees as images, so it can look at what it built), the `checks`, and `compute_seconds`. A script that raises answers `ok: false` with `error: { message, line }` — not a tool error — so the agent reads it and fixes the line. The full fields are in the [API reference](/docs/api/computers#build-a-3d-model).

## For video

Combine the two with [`generate_video`](/docs/api/video): get the object with either tool, render one keyframe per shot with `build_3d` (`engine: "blender"`, `render.views`), and animate each keyframe by passing it as `image_urls`. Every shot shows the same object because it is the same model. A plain turntable is cheaper rendered straight from Blender.

## Pricing

| | Price |
| - | - |
| Generated, from a photo, untextured / textured | `$0.26` / `$0.39` |
| Generated, from a photo, detailed model | `$0.65` |
| Generated, from a description, untextured / textured / rigged | `$0.52` / `$0.78` / `$0.988` |
| Built | The computer's running seconds — a CAD part with three previews is about `$0.002` on an agent's computer |

A generated model is one charge for the finished file, taken when the job completes. Render time, file size and polygon count leave that figure unchanged. A failed job is free. [`GET /v1/media/models?kind=mesh`](/docs/api/media) lists each option as `prices[].micro_usd`. See [Pricing](/docs/platform/pricing#3d-assets).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.