Skip to content

Create Task API ​

API Overview ​

Generate a depth map from one input image.

ProtocolEndpointMethodAuthRequest FormatResponse Format
HTTP/open-api/v1/depth/create-taskPOSTBearermultipart/form-dataapplication/json

Request Headers ​

ParameterValueDescription
Content-Typemultipart/form-dataData exchange format
AuthorizationBearerReplace {accessToken} with the accessToken obtained above

Request Body (HTTP Form Submission) ​

ParameterTypeRequiredDescription
imagefileYes, either with image_urlInput image used for depth map generation.
• Format: png, jpeg, jpg, webp
• Size: max 20 MB
• Count: 1 file
image_urlstringYes, either with imageInput image URL used for depth map generation.
• Format: png, jpeg, jpg, webp
• Size: max 20 MB
• Count: 1 URL
model_typestringYesModel type for depth generation quality. Default is pro.
Enum values:
• base: standard quality model (1K)
• pro: higher quality model (2K)
height_reliefBigDecimalNoRelief height. Default is 1.3.
Allowed values: 0.1–50.0
rmbgintYesRemove background switch. Default is 1.
Enum values:
• 0: disabled
• 1: enabled
degree_rmbgBigDecimalNoAvailable when rmbg=1. Background removal strength. Default is 0.02.
Allowed values: 0.00–1.00, hundredths only
shape_baseintNoAvailable when rmbg=0. Base shape. Default is 0 (square).
Enum values:
• 0: square
• 1: circle
thickness_basestringNoAvailable when rmbg=0. Base thickness in mm. Default is 1.0.
Allowed values: 0.1–20.0, tenths only
widthintNoWidth in mm. Default is 40.
Allowed values: 20–600
sculpmodeintNoSculpt mode. Default is 0 (emboss).
Enum values:
• 0: emboss
• 1: engrave
response_formatstringNoReturn format of generation result. Default is url.
formatintYesDepth map output format.
Enum values:
• 1: exr
• 2: png
• 3: stl
• 4: glb
• 5: 3mf
• 6: bmp

Note: 6 means bmp for this endpoint; the general Image to 3D endpoint uses 6=3mf.
callback_urlstringNoCallback endpoint for task status changes. Request method is POST and callback payload matches query-task response structure.
Callback states include:
• success
• failed

Response Body ​

ParameterFieldTypeDescription
code-intError code, see error code table
datatask_idstringAsynchronous task ID generated by Hi3D, used to query task result afterward
msg-stringDetailed error message
json
{
  "code": 200,
  "data": {
    "task_id": "depth_20260312_8f92ab3e1cde"
  },
  "msg": "success"
}

Error Codes ​

Error codes are returned in JSON structure, including code and msg.

json
{
  "code": 5001001,
  "data": {},
  "msg": "generate failed"
}
Error CodeError MessageError Description
200-Task created successfully
5001001generate failedTimeout or model failed to parse the input image. Retry later; credits are refunded

Request Examples (Shell & Python) ​

shell
curl --location --request POST 'https://api.hitem3d.ai/open-api/v1/depth/create-task' \
--header 'Authorization: Bearer {{accessToken}}' \
--form 'image=@"/path/to/demo.jpg"' \
--form 'model_type="base"' \
--form 'height_relief="1.3"' \
--form 'format="6"' \
--form 'response_format="url"' \
--form 'callback_url="https://client.example.com/webhook/depth"'
python
import requests

url = "https://api.hitem3d.ai/open-api/v1/depth/create-task"
headers = {"Authorization": "Bearer {{accessToken}}"}
data = {
    "model_type": "base",
    "height_relief": "1.3",
    "format": "6",
    "response_format": "url",
}

with open("/path/to/demo.jpg", "rb") as image:
    response = requests.post(url, headers=headers, data=data, files={"image": image})
response.raise_for_status()
print(response.json())