Tripo 3D model generation supports text-to-3D, single-image-to-3D, and multi-image-to-3D models.
Related documentation: User guide
Since 3D model generation is time-consuming, the API uses an asynchronous call. The process involves two steps: create a task and then poll for the result.
China (Beijing):
China (Beijing):
If an API call fails, refer to Error messages for troubleshooting.
Prerequisites
- Enable the service: Go to the Alibaba Cloud Model Studio console, search for "Tripo", find the Tripo model card, and click Enable Now. In the dialog box, confirm the authorization.
- Configure your API key: Select a region, get an API key, and then configure the API key as an environment variable.
HTTP calls
Since 3D model generation is time-consuming, the API uses an asynchronous call. The process involves two steps: create a task and then poll for the result.
Step 1: Create a task
China (Beijing): POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/3d-generation
Replace {WorkspaceId} with your actual workspace ID.
- After the task is created, use the returned
task_idto query the result. Thetask_idis valid for 24 hours. Do not create duplicate tasks. Instead, use polling to retrieve the result. - For guidance for beginners, see Call APIs with Postman or cURL.
Request parametersRequest headersContent-Typestring (Required)The content type of the request. Must be application/json.Authorization string (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.X-DashScope-Async string (Required)Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be enable.Request bodymodelstring (Required)The model name. Valid values:
object (Required)The model input. The prompt, image, and images parameters are mutually exclusive; provide only one.
Properties prompt string (Conditionally required)A text description of the desired 3D model. Required only for text-to-3D model.Multiple languages (such as Chinese and English) are supported. Each character, including Chinese characters and English letters, counts as one character. The maximum length is 1,024 characters.Example: a cute cat.image string (Conditionally required)The URL of a single image. Required only for single-image-to-3D model.Image requirements:
array[object] (Conditionally required)A list of image objects. Required only for multi-image-to-3D model.The array length is fixed at 4, in the order: front, left, back, right.
object (Optional)Optional parameters to control 3D model generation.
Properties texture_quality string (Optional)The quality of the texture. A texture is an image that wraps a 3D model's surface to define its visual appearance and details.Valid values:
string (Optional)Supported model: Tripo/Tripo-H3.1. Tripo/Tripo-P1.0 ignores this parameter without returning an error.The geometric precision of the model. Valid values:
boolean (Optional)Specifies whether to generate a PBR material model. PBR materials include base color (base_color), metallic, roughness, and normal maps. Default value: true.When pbr is set to true, texturing is automatically enabled (texture is also set to true), and the result includes pbr_model_url.texture boolean (Optional)Specifies whether to generate a texture. Default value: true.To generate an untextured model, set both texture and pbr to false. The result includes base_model_url.quad boolean (Optional)Supported model: Tripo/Tripo-H3.1. Tripo/Tripo-P1.0 ignores this parameter without returning an error.Specifies whether to output a quad mesh instead of triangles. Default value: false.When enabled, the output format is forced to FBX. If face_limit is not set, the default face count is 10,000.smart_low_poly boolean (Optional)Supported model: Tripo/Tripo-H3.1. Tripo/Tripo-P1.0 ignores this parameter without returning an error.Specifies whether to generate a smart low-poly model, which has a hand-crafted style and clean topology. Default value: false. Best suited for simple inputs. Generation may occasionally fail for complex models.When enabled, face_limit ranges from 500 to 20,000 for triangle faces and from 500 to 10,000 for quad faces. If generate_parts is also enabled, generate_parts does not take effect.generate_parts boolean (Optional)Supported model: Tripo/Tripo-H3.1. Tripo/Tripo-P1.0 ignores this parameter without returning an error.Specifies whether to generate editable segmented parts. Default value: false.When enabled, this parameter is incompatible with the following parameters:
texture and pbr or set them to false, and do not pass texture_quality, quad, or smart_low_poly.compress string (Optional)Supported model: Tripo/Tripo-H3.1.The compression mode. If not specified, no compression is applied. Valid values:
string (Optional)The negative prompt, which describes content you do not want in the 3D model. Maximum length: 255 characters.face_limit integer (Optional)The maximum number of faces in the generated 3D model. If not specified, the model determines it adaptively. Valid range:
integer (Optional)The random seed for geometry generation. Valid range: -2147483648 to 2147483647.The same seed and input produce the same 3D mesh. If not set, a random seed is used each time.image_seed integer (Optional)The random seed for the image generation step. Valid range: -2147483648 to 2147483647.It is mainly used to generate the reference image from the prompt in text-to-3D model. For single-image-to-3D and multi-image-to-3D model, it takes effect only when enable_image_autofix is enabled or texture_quality is detailed or extreme, and usually does not need to be set.texture_seed integer (Optional)The random seed for texture generation. Valid range: -2147483648 to 2147483647.The same seed produces the same texture. If not set, a random seed is used each time. To get models with the same geometry but different textures, keep model_seed unchanged and change texture_seed.texture_alignment string (Optional)The texture alignment method. Valid values:
string (Optional)The model orientation. Takes effect only when texture is true. Valid values:
string (Optional)The orientation (forward axis) of the exported model. Valid values:
boolean (Optional)Specifies whether to automatically scale the model to real-world size. Default value: false. When enabled, the model size is in meters, which suits AR/VR or game engine scenarios.export_uv boolean (Optional)Specifies whether to perform UV unwrapping during generation. Default value: true. Set it to false to speed up generation and reduce file size. UV unwrapping is then handled in the texturing stage.enable_image_autofix boolean (Optional)Specifies whether to automatically fix the input image. Default value: false. Takes effect only for single-image-to-3D model (when image is passed). |
|
Response parametersoutputobjectThe task output information.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
stringUnique request identifier for tracing and troubleshooting.code stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes. |
Save the task_id to query the task status and result. |
Step 2: Query the task result
China (Beijing): GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
- Polling recommendation: 3D model generation usually takes 30 to 120 seconds. We recommend using a polling mechanism: query 10 seconds after submitting the task, and then every 15 to 30 seconds.
- Task status flow: PENDING (queued) → RUNNING (processing) → SUCCEEDED (successful) / FAILED (failed).
- Task ID validity: The task ID is valid for 24 hours. After this period, you can no longer query the result, and the API returns the task status as
UNKNOWN. - RPS limit: The default RPS for the query API is 20. For higher-frequency queries or event notifications, we recommend that you configure asynchronous task callbacks.
- More operations: To query tasks in batches or cancel a task, see Manage Asynchronous Tasks.
Request parametersRequest headersAuthorizationstring (Required)Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.Path parameterstask_idstring (Required)The ID of the task. |
Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours, Replace {WorkspaceId} with your actual workspace ID. |
Response parametersoutputobjectThe task output information.
Properties task_id stringThe task ID. Valid for queries for 24 hours.task_status stringThe status of the task.
Enumeration values
stringThe time when the task was submitted. format is YYYY-MM-DD HH:mm:ss.SSS.scheduled_time stringThe time when the task was executed. format is YYYY-MM-DD HH:mm:ss.SSS.end_time stringThe time when the task was completed. format is YYYY-MM-DD HH:mm:ss.SSS.resultsarrayThe generation results. This field is returned only when the task status is SUCCEEDED. Each URL is a signed temporary link that is valid for 2 hours. Please download it promptly.
Properties model_url stringThe URL of the 3D model. Returned for all generation tasks.pbr_model_url stringThe URL of the PBR material model, in GLB format when quad is disabled or FBX format when quad is enabled. Returned when pbr is true (default) and generate_parts is not enabled. Not returned when texture is true and pbr is false. In this case, get the textured model from model_url.base_model_url stringThe URL of the untextured base model, in GLB format when quad is disabled or FBX format when quad is enabled. Returned when both texture and pbr are set to false.rendered_image_url stringThe URL for the rendered preview image of the 3D model.generated_image_url stringThe URL of the intermediate image generated from the prompt in text-to-3D model tasks.stringThe original input prompt, corresponding to the request parameter prompt.code stringError code. Returned only for failed requests. See Error codes.message stringDetailed error message. Returned only for failed requests. See Error codes.objectUsage statistics for the task. Returned only when the task succeeds. Not returned for failed tasks.
Properties 3d_task_type stringThe type of 3D model generation task.
integerThe credits consumed by the task. Formula:credits_consumed = Base item credits + texture_quality + geometry_quality + quad + smart_low_poly + generate_parts
integerThe additional credits for generating textures, calculated based on texture quality. If textures are generated without texture_quality, including when no texture parameters are passed, the task is billed as standard. Not returned when an untextured model is generated (both texture and pbr are false).geometry_quality integerThe additional credits for using Ultra geometric precision. Returned only for Tripo/Tripo-H3.1 when geometry_quality is ultra.quad integerThe additional credits for outputting a quad mesh. Returned only when quad is enabled for Tripo/Tripo-H3.1.smart_low_poly integerThe additional credits for generating a smart low-poly model. Returned only when smart_low_poly is enabled for Tripo/Tripo-H3.1.generate_parts integerThe additional credits for generating parts. Returned only when generate_parts is enabled and takes effect for Tripo/Tripo-H3.1. |
|