# Smart Segmentation

**Base URL:** `https://openapi.tripo3d.ai/v3`

**Endpoint:** `POST /mesh/smartsegment`

End-to-end smart segmentation pipeline. Submit via `file_token` or URL. Supports `seg_type=image` and `seg_type=model` (GLB only). Differs from Mesh Segmentation: SmartSegment includes auto modeling; `/v3/mesh/segment` only segments an existing model.

## Request Parameters

### seg_type

- **Type:** string
- **Required:** Required

Segmentation pipeline type.
- `image` — image pipeline (PNG / JPEG / WebP)
- `model` — model pipeline (**GLB only**; `transform` required)

### input

- **Type:** string
- **Required:** Required

Input source. Accepts `file_token` (from File Upload or Presign Upload) or a public URL.For `seg_type=model`, the file **must be GLB**.

### granularity

- **Type:** string
- **Required:** Optional
- **Default:** `medium`

Segmentation granularity.
- `coarse`
- `medium` — default
- `fine`

### hint

- **Type:** string
- **Required:** Optional

Optional hint text to help identify parts that should be segmented.
### transform

- **Type:** number[]
- **Required:** Conditional

**Required when **`seg_type=model`. Column-major 4×4 transform matrix (16 floats). Identity example: `[1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]`

## Request Example

### Image pipeline

```bash
curl --request POST \
  --url https://openapi.tripo3d.ai/v3/mesh/smartsegment \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "seg_type": "image",
  "input": "file_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "granularity": "medium",
  "hint": "game character with sword and armor"
}'
```

### Model pipeline

```bash
curl --request POST \
  --url https://openapi.tripo3d.ai/v3/mesh/smartsegment \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "seg_type": "model",
  "input": "https://example.com/character.glb",
  "transform": [
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    1,
    0,
    0,
    0,
    0,
    1
  ],
  "granularity": "fine",
  "hint": "character body parts"
}'
```


## Response Example

### Create task

```json
{
  "code": 0,
  "data": {
    "task_id": "task_abc123"
  }
}
```

### Task result

```json
{
  "code": 0,
  "data": {
    "task_id": "task_abc123",
    "type": "smartsegment_image",
    "status": "success",
    "progress": 100,
    "input": {
      "granularity": "medium"
    },
    "output": {
      "prompt": "head, body, left arm, right arm, legs",
      "mask_url": "https://cdn.tripo3d.ai/output/mask.png",
      "seg_model_url": "https://cdn.tripo3d.ai/output/seg_model.glb",
      "seg_task_id": "task_seg456",
      "model_task_id": "task_model789"
    },
    "credits_consumed": 85.00,
    "created_at": "2026-06-30T09:08:14Z",
    "completed_at": "2026-06-30T09:14:15Z"
  }
}
```
