Generate Assets
Use the POST /api/v1/generate endpoint to create 3D models, ASCII art, and sprite animations from text prompts.
Endpoint
POST https://meshroom.app/api/v1/generate
All generation requests use the same endpoint. The mode field determines which asset type is created.
3D Models2 CREDITS
Generate textured 3D meshes from a text description. Output is a GLB file ready for web viewers, game engines, or AR applications.
+----+
/ /|
+----+ |
| | +
| |/
+----+
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| mode | string | YES | Set to "trellis" |
| prompt | string | YES | Text description of the 3D model |
| options.meshSimplify | number | No | Simplification ratio 0-1 (default 0.95) |
| options.textureSize | number | No | 512, 1024, or 2048 (default 1024) |
Example Request
curl -X POST https://meshroom.app/api/v1/generate \
-H "Authorization: Bearer mr_live_..." \
-H "Content-Type: application/json" \
-d '{
"mode": "trellis",
"prompt": "a low-poly medieval castle",
"options": { "meshSimplify": 0.95, "textureSize": 1024 }
}'
Example Response
{
"id": "gen_abc123",
"status": "completed",
"mode": "trellis",
"model_url": "https://meshroom.app/assets/gen_abc123.glb",
"credits_used": 2
}
ASCII Art1 CREDIT
Generate animated ASCII art frames from a prompt. Returns an array of text frames that can be played back sequentially for terminal-style animations.
)
) \
/ ) (
\(_)/
^^^^
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| mode | string | YES | Set to "ascii" |
| prompt | string | YES | Text description of the ASCII art |
Example Request
curl -X POST https://meshroom.app/api/v1/generate \
-H "Authorization: Bearer mr_live_..." \
-H "Content-Type: application/json" \
-d '{"mode": "ascii", "prompt": "a spinning globe"}'
Example Response
{
"id": "gen_def456",
"status": "completed",
"mode": "ascii",
"frames": [" .---. \n / \\ \n...", ...],
"credits_used": 1
}
Sprite Animations2 CREDITS
Create animated sprite sheets from a text prompt. Configure frame count, art style, animation type, and background transparency for game-ready assets.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| mode | string | YES | Set to "animation" |
| prompt | string | YES | Text description of the sprite |
| options.frameCount | number | No | Number of frames (default 8) |
| options.artStyle | string | No | "pixel-art", "hand-drawn", etc. |
| options.animationType | string | No | "idle", "walk", "attack", etc. |
| options.background | string | No | "transparent" or "white" |
Example Request
curl -X POST https://meshroom.app/api/v1/generate \
-H "Authorization: Bearer mr_live_..." \
-H "Content-Type: application/json" \
-d '{
"mode": "animation",
"prompt": "a knight swinging a sword",
"options": {
"frameCount": 8,
"artStyle": "pixel-art",
"animationType": "attack",
"background": "transparent"
}
}'
Example Response
{
"id": "gen_ghi789",
"status": "completed",
"mode": "animation",
"spritesheet_url": "https://meshroom.app/assets/gen_ghi789.png",
"frame_count": 8,
"credits_used": 2
}
Full Parameters Reference
| Parameter | Type | Modes | Description |
|---|---|---|---|
| mode | string | all | Generation mode: "trellis", "ascii", or "animation" |
| prompt | string | all | Text description of the asset to generate |
| options.meshSimplify | number (0-1) | trellis | Mesh simplification ratio |
| options.textureSize | 512 | 1024 | 2048 | trellis | Texture resolution in pixels |
| options.frameCount | number | animation | Number of animation frames |
| options.artStyle | string | animation | Art style (pixel-art, hand-drawn, etc.) |
| options.animationType | string | animation | Animation type (idle, walk, attack, etc.) |
| options.background | string | animation | "transparent" or "white" |