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:
pro: higher quality model (2K)
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.001.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.120.0, tenths only
widthintNoWidth in mm. Default is 40.
Allowed values: 20600
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
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 Example (Shell)

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 'format="1"' \
--form 'response_format="url"' \
--form 'callback_url="https://client.example.com/webhook/depth"'