TRIVERSE Docs
API Endpoints

Texturing

Apply high-quality textures to existing 3D geometry. Whether you have a mesh generated by Triverse or an external model, you can use images or text prompts to define its appearance.

Image-Based Texturing

Apply textures to a geometric model using a reference image.

Endpoint

POST /tasks/texture-model

Authentication

Required (Bearer Token)

Request Parameters

ParameterTypeDefaultDescription
image_fileStringRequiredReference image file_key or public URL.
model_fileStringRequiredGeometry model file_key or public URL.
model_versionStringv2Model version.
polygon_limitInteger1,000,000Polygon limit. Valid range: 1,000 to 1,500,000.
texture_sizeInteger1024Texture resolution. Valid range: 1024 to 4096.
client_order_idStringNoneOptional idempotency key. When provided, it must be unique per user and 1-64 characters using only letters, numbers, underscores, or hyphens.
allow_duplicateBooleanNoneSet to true to intentionally resubmit a request that would otherwise match the short duplicate window.

Example Request

cURL

curl -X 'POST' \
  'https://api.triverse.ai/api/v1/tasks/texture-model' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "image_file": "tasks/uid_64e96053-76ab-4e9c-bd82-2def925b53bc/20250805/texture_ref.png",
  "model_file": "https://triverse-public.oss-cn-beijing.aliyuncs.com/tasks/2025-08-05/20/model.glb",
  "polygon_limit": 1000000,
  "texture_size": 1024,
  "client_order_id": "texture-model-example-001"
}'

JavaScript

const response = await fetch(
  "https://api.triverse.ai/api/v1/tasks/texture-model",
  {
    method: "POST",
    headers: {
      Accept: "application/json",
      Authorization: "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      image_file:
        "tasks/uid_64e96053-76ab-4e9c-bd82-2def925b53bc/20250805/texture_ref.png",
      model_file:
        "https://triverse-public.oss-cn-beijing.aliyuncs.com/tasks/2025-08-05/20/model.glb",
      polygon_limit: 1000000,
      texture_size: 1024,
    }),
  },
);
const data = await response.json();
console.log(data);

Python

import requests

response = requests.post(
    "https://api.triverse.ai/api/v1/tasks/texture-model",
    headers={
        "Accept": "application/json",
        "Authorization": "Bearer <YOUR_API_KEY>",
    },
    json={
        "image_file": "tasks/uid_64e96053-76ab-4e9c-bd82-2def925b53bc/20250805/texture_ref.png",
        "model_file": "https://triverse-public.oss-cn-beijing.aliyuncs.com/tasks/2025-08-05/20/model.glb",
        "polygon_limit": 1000000,
        "texture_size": 1024,
    },
)
print(response.json())

Text-Based Texturing

Define the texture of an existing model using only a text prompt.

Endpoint

POST /tasks/text-to-texture

Authentication

Required (Bearer Token)

Request Parameters

ParameterTypeDefaultDescription
text_promptStringRequiredDescription of the desired texture. Minimum length: 3 characters.
model_urlStringRequiredPublic URL of the geometric model.
model_versionStringv2Model version.
polygon_limitInteger1,000,000Polygon limit. Valid range: 1,000 to 1,500,000.
texture_sizeInteger1024Texture resolution. Valid range: 1024 to 4096.
client_order_idStringNoneOptional idempotency key. When provided, it must be unique per user and 1-64 characters using only letters, numbers, underscores, or hyphens.
allow_duplicateBooleanNoneSet to true to intentionally resubmit a request that would otherwise match the short duplicate window.

Note: For text-to-texture, the model_url must be a publicly accessible URL. You can use the Presigned Download URL endpoint to generate one if needed.

Example Request

cURL

curl -X 'POST' \
  'https://api.triverse.ai/api/v1/tasks/text-to-texture' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "text_prompt": "a stylized leather texture with visible stitches",
  "model_url": "https://triverse-public.oss-cn-beijing.aliyuncs.com/tasks/2025-08-05/20/geometry_model.glb",
  "model_version": "v2",
  "polygon_limit": 1000000,
  "texture_size": 1024,
  "client_order_id": "text-texture-example-001"
}'

JavaScript

const response = await fetch(
  "https://api.triverse.ai/api/v1/tasks/text-to-texture",
  {
    method: "POST",
    headers: {
      Accept: "application/json",
      Authorization: "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      text_prompt: "a stylized leather texture with visible stitches",
      model_url:
        "https://triverse-public.oss-cn-beijing.aliyuncs.com/tasks/2025-08-05/20/geometry_model.glb",
      model_version: "v2",
      polygon_limit: 1000000,
      texture_size: 1024,
    }),
  },
);
const data = await response.json();
console.log(data);

Python

import requests

response = requests.post(
    "https://api.triverse.ai/api/v1/tasks/text-to-texture",
    headers={
        "Accept": "application/json",
        "Authorization": "Bearer <YOUR_API_KEY>",
    },
    json={
        "text_prompt": "a stylized leather texture with visible stitches",
        "model_url": "https://triverse-public.oss-cn-beijing.aliyuncs.com/tasks/2025-08-05/20/geometry_model.glb",
        "model_version": "v2",
        "polygon_limit": 1000000,
        "texture_size": 1024,
    },
)
print(response.json())

On this page