Sam 3D Object Serverless API

Transforms a single 2D image into detailed 3D models with remarkable accuracy.

~33.44s
~$0.065
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/sam-3d-objects"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://segmind-resources.s3.amazonaws.com/input/574b0eaa-a474-47fd-8e48-9eb107f76d8e-car.png",
12    "prompt": "car",
13    "seed": 123,
14    "include_artifacts": false
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20    result = response.json()
21    print(json.dumps(result, indent=2))
22else:
23    print(f"Error: {response.status_code}")
24    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/sam-3d-objects

Parameters

imagerequired
string (uri)

Provide an image as a URL, file path, or base64 string to create a 3D object. Use a vehicle image URL for car modeling.

bounding_boxoptional
string

Specify object region with a bounding box. Example: [50, 75, 350, 400]

Default: null
include_artifactsoptional
boolean

Include processing artifacts in a ZIP for debugging. Enable for detailed analysis or disable for faster outputs.

Default: false
maskoptional
string (uri)

Use a mask image to specify 3D reconstruction regions. Optional for complex scenes, useful for precise object targeting.

Default: null
point_coordsoptional
string

Define object location with point coordinates. For ex: [[x1,y1]] or [[x1,y1],[x2,y2]]

Default: null
promptoptional
string

Guide object selection with a text prompt. Use 'bicycle' or 'tree' for specific object creation.

Default: null
seedoptional
integer

Set a random seed for repeatability. Choose 123 for unique experiments or 42 for standard reproducible results.

Default: 123Range: 0 - 1000000

Response Type

Returns: 3D Model

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out