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
response_formatstringNoReturn format of generation result. Default is url.
formatintYesDepth map output format.
Enum values:
1: exr
2: png
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 Hitem3D, 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"'