Skip to content

Text to 3D

Shows how to create a text-to-3D preview task and poll for completion.

This example assumes using Meshy; is in scope and apiKey contains your Meshy API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
using var client = new MeshyClient(apiKey);

// Create a text-to-3D preview task using an implicit conversion.
var response = await client.TextTo3d.CreateTextTo3DTaskAsync(
    new TextTo3DPreviewRequest
    {
        Mode = TextTo3DPreviewRequestMode.Preview,
        Prompt = "a wooden treasure chest",
        AiModel = AiModel.Latest,
    });
Console.WriteLine($"Task ID: {response.Result}");

// Poll the task until it completes.
var task = await client.TextTo3d.GetTextTo3DTaskAsync(response.Result!);
Console.WriteLine($"Status: {task.Status}, Progress: {task.Progress}%");