# Sam 3 · 3D Objects API

> टेक्स्ट, पॉइंट या बॉक्स प्रॉम्प्ट अथवा मास्क से चुने गए ऑब्जेक्ट का छवि से 3D पुनर्निर्माण, जिसमें splat आउटपुट मिलता है

फ़ोटो में मौजूद ऑब्जेक्ट को 3D एसेट में बदलता है। `mask_urls`, टेक्स्ट `prompt`, `point_prompts` या `box_prompts` से ऑब्जेक्ट चुनें; कई बॉक्स अलग-अलग ऑब्जेक्ट देते हैं। `detection_threshold` 0.1 से 1 स्वीकार करता है, और `export_textured_glb` टेक्सचर तथा UVs को बेक करता है। GLB, Gaussian splat फ़ाइलें, मल्टी-ऑब्जेक्ट दृश्यों के लिए प्रति-ऑब्जेक्ट फ़ाइलें, मेटाडेटा और zip बंडल आउटपुट करता है।

- Model id: `sam-3/3d-objects`
- Made by: Meta
- Category: Image to 3D
- Output: 3d
- Estimated price per run: $0.02 / run (cheapest run $0.02 (20 API credits))
- Run: `POST https://api.doitong.com/v1/run/sam-3/3d-objects`
- Quote: `POST https://api.doitong.com/v1/quote/sam-3/3d-objects`
- Docs page: https://doitong.com/hi/developers/models/sam-3/3d-objects

## Pricing

Price: **$0.02 / run**. Estimated from the typical cost of one run. The quote is exactly what the run charges.

The full example input below costs $0.02 = 20 API credits (1 request × 20 API credits).

Prices are the upstream price in USD, paid from the API balance in API credits (1000 API credits = 1 USD). `POST https://api.doitong.com/v1/quote/sam-3/3d-objects` with the same JSON body returns the exact price for that input; the quote is exactly what a run charges. Invalid input is never charged and failed or canceled requests are refunded automatically.

## Input parameters

Send either the canonical name or the native field name (not both). Canonical names are the same across models.

| Parameter | Canonical name | Type | Required | Default | Allowed values / range | Description |
|---|---|---|---|---|---|---|
| `image_url` | `image` | string (image URL) | yes |  |  | 3D पुनर्निर्माण के लिए इमेज का URL। |
| `mask_urls` |  | array of image URL | no |  |  | हर ऑब्जेक्ट के लिए मास्क URL की वैकल्पिक सूची। मास्क न होने पर, ऑटोमैटिक सेगमेंटेशन दिए गए प्रॉम्प्ट, point_prompts या box_prompts का उपयोग करता है; यदि न मास्क दिए गए हों और न सेगमेंटेशन प्रॉम्प्ट, तो पूरी इमेज का उपयोग होता है। |
| `prompt` |  | string \| null | no | `car` |  | मास्क न होने पर ऑटोमैटिक सेगमेंटेशन के लिए इस्तेमाल किया जाने वाला टेक्स्ट, जैसे 'chair' या 'lamp'। |
| `point_prompts` |  | array of object {x, y, label, object_id} | no | `[]` |  | मास्क न होने पर ऑटोमैटिक सेगमेंटेशन के लिए इस्तेमाल किए जाने वाले बिंदु-आधारित प्रॉम्प्ट। |
| `point_prompts[].x` |  | integer \| null | no |  |  | X अक्ष पर प्रॉम्प्ट की स्थिति। |
| `point_prompts[].y` |  | integer \| null | no |  |  | Y अक्ष पर प्रॉम्प्ट की स्थिति। |
| `point_prompts[].label` |  | enum (integer) \| null | no |  | `0`, `1` | फ़ोरग्राउंड/बैकग्राउंड लेबल: 1 फ़ोरग्राउंड दर्शाता है; 0 बैकग्राउंड दर्शाता है। |
| `point_prompts[].object_id` |  | integer \| null | no |  |  | एक ऑब्जेक्ट को परिष्कृत करने वाले प्रॉम्प्ट को समूहित करने वाला वैकल्पिक पहचानकर्ता। यदि टेक्स्ट भी प्रॉम्प्ट के रूप में दिया गया है, तो यह पहचानकर्ता निर्धारित करता है कि पहचाने गए किस ऑब्जेक्ट को वे पॉइंट परिष्कृत करेंगे। |
| `box_prompts` |  | array of object {x_min, y_min, x_max, y_max, object_id} | no | `[]` |  | बॉक्स प्रॉम्प्ट जो ऑटोमैटिक सेगमेंटेशन के ज़रिए 3D पुनर्निर्माण के लिए अलग-अलग ऑब्जेक्ट मास्क बनाते हैं। इनका उपयोग केवल तब होता है जब कोई मास्क नहीं दिया गया हो। कई बॉक्स भेजे जा सकते हैं। |
| `box_prompts[].x_min` |  | integer \| null | no |  |  | बॉक्स के लिए न्यूनतम x-coordinate। |
| `box_prompts[].y_min` |  | integer \| null | no |  |  | बॉक्स के लिए न्यूनतम y-coordinate। |
| `box_prompts[].x_max` |  | integer \| null | no |  |  | बॉक्स का अधिकतम X कोऑर्डिनेट। |
| `box_prompts[].y_max` |  | integer \| null | no |  |  | बॉक्स का अधिकतम Y कोऑर्डिनेट। |
| `box_prompts[].object_id` |  | integer \| null | no |  |  | एक ऑब्जेक्ट को परिष्कृत करने वाले बॉक्स को समूहित करने वाला वैकल्पिक पहचानकर्ता। |
| `seed` |  | integer \| null | no |  |  | पुनरुत्पाद्य रैंडम निर्माण के लिए उपयोग किया गया सीड। |
| `pointmap_url` |  | string \| null | no |  |  | NPY या NPZ के रूप में बाहरी pointmap या डेप्थ डेटा देकर 3D पुनर्निर्माण में गहराई के अनुमान को बेहतर बनाने के लिए वैकल्पिक URL। |
| `detection_threshold` |  | number \| null | no |  | 0.1 – 1 | पहचान के कॉन्फ़िडेंस की न्यूनतम सीमा; इसे न देने पर मॉडल का डिफ़ॉल्ट उपयोग होता है। मान 0.1 से 1.0 तक हो सकते हैं; छोटे मान पहचान की संख्या बढ़ाते हैं, लेकिन सटीकता घटाते हैं। |
| `export_textured_glb` |  | boolean | no | `false` |  | GLB एक्सपोर्ट का विकल्प: इसे सक्षम करने पर वर्टेक्स रंगों की जगह बेक किया गया टेक्सचर और UVs इस्तेमाल होते हैं। |

File parameters (`image`, `mask_urls`) take a public `https://` URL, a `data:` URI up to 10 MB, or the `file_url` of an upload from `POST /files`.

## Example input

Required parameters only:

```json
{
  "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
```

A fuller example:

```json
{
  "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
```

## Run it

Set `DOITONG_API_KEY` to a key from https://doitong.com/developers/dashboard#keys. `?wait=20` returns the finished request in the same call when it is ready within 20 seconds; otherwise poll `GET /requests/{id}` (it also accepts `?wait=`), or pass `webhook_url`.

### curl

```bash
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/sam-3/3d-objects?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"
```

### JavaScript

```javascript
const API = "https://api.doitong.com/v1";
const headers = {
  "Authorization": "Bearer " + process.env.DOITONG_API_KEY,
  "Content-Type": "application/json",
};

// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/sam-3/3d-objects?wait=20", {
  method: "POST",
  headers,
  body: JSON.stringify({
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);

// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
  res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
  request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
```

### Python

```python
import os
import requests

API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}

payload = {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
}

# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/sam-3/3d-objects", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
    raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])

# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
    request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
    raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
```

### MCP

The MCP server at `https://api.doitong.com/v1/mcp` exposes the tools `search_models`, `get_model`, `quote`, `run`, `get_request`, `cancel_request`, `list_requests`, `create_upload` and `get_account`. A `run` call for this model:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run",
    "arguments": {
      "model_id": "sam-3/3d-objects",
      "input": {
        "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
      },
      "wait_seconds": 20
    }
  }
}
```

## Response

Every call returns a request object. `status` is one of `queued`, `running`, `succeeded`, `failed`, `canceled`. `outputs` lists the generated files with URLs on our storage (kept forever, or 7 days with `?storage=temporary`; `storage` says which); `output` is the model's own result object with the same URLs.

```json
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam-3/3d-objects",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 20,
    "usd": "0.02",
    "charged": 20,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "gaussian_splat": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "model_glb": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    },
    "metadata": [
      {
        "object_index": 1,
        "scale": [
          []
        ],
        "rotation": [
          []
        ],
        "translation": [
          []
        ],
        "camera_pose": [
          []
        ]
      }
    ],
    "individual_splats": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200
      }
    ],
    "individual_glbs": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200
      }
    ],
    "artifacts_zip": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_name": "0-output.jpeg",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
```

### Output fields (`output`)

| Field | Type | Description |
|---|---|---|
| `gaussian_splat` | object {url, content_type, file_name, file_size} | कई ऑब्जेक्ट वाले परिणामों के लिए संयुक्त सीन स्प्लैट, अन्यथा एक स्प्लैट; .ply फ़ॉर्मैट में गॉसियन स्प्लैट फ़ाइल के रूप में दिया जाता है। |
| `model_glb` | object {url, content_type, file_name, file_size} | GLB के रूप में सहेजा गया 3D आउटपुट: कई ऑब्जेक्ट को एक सीन में जोड़ा जाता है, जबकि अन्य परिणामों में एक मेश होता है। |
| `metadata` | array of object {object_index, scale, rotation, translation, camera_pose} | प्रत्येक ऑब्जेक्ट का मेटाडेटा, जिसमें रोटेशन, ट्रांसलेशन और स्केल शामिल हैं। |
| `individual_splats` | array of object {url, content_type, file_name, file_size} \| null | प्रत्येक ऑब्जेक्ट के लिए अलग गॉसियन स्प्लैट फ़ाइलें, जो केवल कई ऑब्जेक्ट वाले सीन में उपलब्ध हैं। |
| `individual_glbs` | array of object {url, content_type, file_name, file_size} \| null | प्रत्येक ऑब्जेक्ट के लिए अलग GLB मेश फ़ाइलें, जो केवल कई ऑब्जेक्ट वाले सीन में उपलब्ध हैं। |
| `artifacts_zip` | object {url, content_type, file_name, file_size} \| null | सभी आर्टिफ़ैक्ट और मेटाडेटा का ZIP आर्काइव। |

## Related models

- [Sam 3 · Image RLE](https://doitong.com/developers/models/sam-3/image-rle.md) (`sam-3/image-rle`): $0.005 / run
- [Segment Anything Model 3](https://doitong.com/developers/models/sam-3/image.md) (`sam-3/image`): $0.005 / run
- [Sam 3 · Video](https://doitong.com/developers/models/sam-3/video.md) (`sam-3/video`): $0.005 / 16 frames of input video
- [Sam 3 · Video RLE](https://doitong.com/developers/models/sam-3/video-rle.md) (`sam-3/video-rle`): $0.005 / 16 frames of input video
- [Sam 3 · 3D Body](https://doitong.com/developers/models/sam-3/3d-body.md) (`sam-3/3d-body`): $0.02 / run
- [Sam 3 · 3D Align](https://doitong.com/developers/models/sam-3/3d-align.md) (`sam-3/3d-align`): $0.02 / run
- [Sam 3 · Image · Embed](https://doitong.com/developers/models/sam-3/image/embed.md) (`sam-3/image/embed`): $0.005 / run
- [Hi3D Image to 3D](https://doitong.com/developers/models/hitem3d/hi3d/image-to-3d.md) (`hitem3d/hi3d/image-to-3d`): $0.50 / run

## Links

- HTML page: https://doitong.com/developers/models/sam-3/3d-objects
- All models and guides for AI agents: https://doitong.com/developers/llms.txt
- OpenAPI 3.1 with this model's typed request body: https://doitong.com/developers/openapi.json?model=sam-3/3d-objects
- Errors: https://doitong.com/developers/docs/errors
- Model details as JSON: https://api.doitong.com/v1/models/sam-3/3d-objects
