OpenAPI Integration
The domain name used to call the OpenAPI ishttps://app.duix.ai/
Prerequisites
Construct Signature to Get Token
When integrating with the duix-openapi-v2 platform, you need to integrate code to generate tokens in your own platform. The method for generating tokens can be referenced in the following code: How to Get TokenManagement Interfaces
Management-type HTTP requests have a common convention that requires passing a token in the request header.Interaction Process

Get APP Real-time Concurrent Number
Interface Address:
/duix-openapi-v2/sdk/v2/getconcurrentNumberRequest Method: GET
Interface Description:
Query the concurrent number under a specific APP
Parameter Description
Parameter Name | Type | Pass Method | Parameter Description |
---|---|---|---|
appId | String | Query | APPID created from the platform |
Parameter Name | Type |
---|---|
code | String |
data | ConcurrentStatus |
cropId | String |
totalConcurrentNumber | integer(int32) |
userConcurrentNumber | integer(int32) |
message | String |
success | boolean |
Get APP Real-time Sessions
Interface Address:
/duix-openapi-v2/sdk/v2/getconcurrentListRequest Method: GET
Interface Description:
Query the list of “in call” sessions under a specific APP.Parameter Description
Parameter Name | Type | Pass Method | Parameter Description |
---|---|---|---|
appId | String | Query | APPID created from the platform |
Close All Sessions of an APP
Interface Address:
/duix-openapi-v2/sdk/v2/distroyCallSessionsByAppIdRequest Method: GET
Interface Description:
Close all sessions under a specific APPParameter Description
Parameter Name | Type | Pass Method | Parameter Description |
---|---|---|---|
appId | String | Query | APPID created from the platform |
Response Example:
Close Specified Session
Interface Address:
/duix-openapi-v2/sdk/v2/sessionStopRequest Method: GET
Parameter Description
Parameter Name | Type | Pass Method | Parameter Description |
---|---|---|---|
uuid | String | Query | sessionId field returned by the start-complete event |
Third-party Dialog Integration (Non-streaming)
Other Session Integration: Other session platforms can be provided for digital humans to use in the following way. The DUIX platform can, through your digital human, use the POST method to request a remote URL you define to get answers to questions.

Session Platform Integration Example: You can refer to this example of session platform integration. This open-source application implements a dialogue platform integration, which implements casual conversation functionality.
Request Specification: The DUIX platform will send question requests (questions customers ask your digital human) in the following format via POST to your remote URL.
Parameter Description
Field | Type | Description | Required |
---|---|---|---|
sid | String | Your user ID, generated when creating a user. Can be viewed in account information. | Y |
dh-code | String | Digital human code, generated when each digital human is created, can be viewed in the digital human overview. | Y |
dh-question | String | The content of the question you need to ask the digital human | Y |
dh-conversation-id | String | Conversation ID, a unique identifier for the conversation | Y |
dh-context | String | Context information generated during the conversation, this information is a stringified JSON format data. | N |
dh-context.q.context | String | the question user asked digital human | N |
dh-context.a.context | String | The answer to the question the user asked the digital human | N |
uuid | String | Request ID, used to track requests and troubleshoot problems | N |
Request Example:
Field | Type | Required | Remarks |
---|---|---|---|
code | String | Y | Status code returned |
msg | String | N | Success/error description message |
data | object | N | Specific content returned |
success | Boolean | Y | Whether successful |
Code | Status | Response |
---|---|---|
200 | OK | Response body according to the specification below |
400 | Bad Request | Request body/headers are invalid |
401 | Unauthorized | Authentication information is invalid |
403 | Forbidden | Authentication failed |
500 | Server Error | Service exception |
Field | Type | Description | Required |
---|---|---|---|
conversationId | String | Conversation ID, a unique identifier for the conversation, same as the dh-conversation-id in the request parameter body. | Y |
question | String | The question asked by the user. | N |
answer | String | The answer to the question the user asked the digital human, this is a stringified JSON object. | Y |
errorMsg | String | Description of the exception or error | N |
Third-party Dialog Integration (Streaming)
Other Session Integration: Other session platforms can be provided for digital humans to use in the following way. The DUIX platform can, through your digital human, use the POST method to request a remote URL you define to get answers to questions.

Session Platform Integration Example: You can refer to this example of session platform integration. This open-source application implements a dialogue platform integration, which implements casual conversation functionality.
Request Specification: The DUIX platform will send question requests (questions customers ask your digital human) in the following format via POST to your remote URL.
Parameter Description
Field | Type | Description | Required |
---|---|---|---|
sid | String | Your user ID, generated when creating a user. Can be viewed in account information. | Y |
dh-code | String | Digital human code, generated when each digital human is created, can be viewed in the digital human overview. | Y |
dh-question | String | The content of the question you need to ask the digital human | Y |
dh-conversation-id | String | Conversation ID, a unique identifier for the conversation | Y |
dh-context | String | Context information generated during the conversation, this information is a stringified JSON format data. | N |
dh-context.q.context | String | the question user asked digital human | N |
dh-context.a.context | String | The answer to the question the user asked the digital human | N |
uuid | String | Request ID, used to track requests and troubleshoot problems | N |
Request Example:
Field | Type | Description | Required |
---|---|---|---|
answer | String | Return answer | Y |
isEnd | boolean | Whether to end | Y |
Get Conversation Details
Interface Address:
/duix-openapi-v2/sdk/getConversationById?conversationId=[duix platform conversation id]Request Method: GET
Interface Description:
Query conversation details based on the conversation id created by the duix platform
Parameter Description
Parameter Name | Type | Pass Method | Parameter Description |
---|---|---|---|
conversationId | String | Query | conversationId created by the platform |
Parameter Name | Type | Description |
---|---|---|
code | String | Return code |
data | JSON | Return data |
detailDto | JSON | Conversation resource details (including model, background, tts) |
detailDto.backgroundDto | JSON | Conversation resource details (background) |
detailDto.modelId | String | Model ID |
detailDto.modelName | String | Model Name |
detailDto.modelIdType | String | Model Type (0: Cloud Digital Human, 1: Local Digital Human) |
detailDto.localModelInfo | JSON | Local Digital Human Information |
detailDto.backgroundDto | JSON | Conversation resource details (background) |
detailDto.backgroundDto.backgroundUrl | String | Background Address |
scriptDtoList | JSON | Frontend Dialog Details |
scriptDtoList.scriptType | String | 0 Wake-up Word, 1 Opening Line, 2 Waiting Phrase, 3 Unknown Question, 4 Farewell Phrase, 5 Interruption Phrase, 6 Interruption Sentence, 7 Guiding Phrase) |
scriptDtoList.scriptContent | String | Frontend Dialog Text |
scriptDtoList.ttsContent | String | Frontend Dialog Audio |
message | String | Text Prompt |
success | boolean | Success Flag |
create avatar
Interface Address:
/duix-openapi-v2/sdk/v2/createAvatarRequest Method: POST
Interface Description:
Create your AI Avatar with api
Parameter Description
Parameter Name | Type | Pass Method | Parameter Description | Required |
---|---|---|---|---|
customType | Integer | body | valid value: 1:training with a video 2:training with a photo | Y |
avatarName | String | body | Avatar Name | Y |
gender | String | body | valid value: male female other | N |
profile | String | body | profile to power your avatar chat. if not empty, default conversation will be automatically created after training | N |
templateVideo | String | body | the URL of the video. cann’t be empty when training with a video | N |
coverUrl | String | body | the URL of the photo. cann’t be empty when training with a photo | N |
audioUrl | String | body | the URL of the audio | N |
ttsSpeaker | String | body | voice selected by the user | N |
videoStart | float | body | the start time in seconds of the video for training. default value is 0 seconds | N |
videoEnd | float | body | the send time in seconds of the video for training. default value is 5 seconds | N |
audioStart | float | body | the start time in seconds of the audio for training. default value is 0 seconds | N |
audioEnd | float | body | the send time in seconds of the audio for training. default value is 10 seconds | N |
- When training with a photo, photo should be jpg/png, max size is 10MB , the recommended resolution is 1080p and the ratio of photo should be 9:16 or 16:9.
- When training with a video, video should be mp4 / MOV, 10s-1mins and maximum file size is 1GB.
- The video duration should be 5 seconds and the audio duration should be between 5 seconds and 10 seconds.
- Audio should be mp3 / wav / flac / m4a, 5s-30mins
Parameter Name | Type | Description |
---|---|---|
code | String | Return code |
data | JSON | Return data |
data.id | int | Avatar ID. You can query the avatar using this ID. |
msg | String | Text Prompt |
success | boolean | Success Flag |
query avatar
Interface Address:
/duix-openapi-v2/sdk/v2/queryAvatarRequest Method: GET
Interface Description:
query your AI Avatar By Avatar id
Parameter Description
Parameter Name | Type | Pass Method | Parameter Description | Required |
---|---|---|---|---|
id | Integer | Query | Avatar id | Y |
Parameter Name | Type | Description |
---|---|---|
code | String | Return code |
msg | String | Text Prompt |
success | boolean | Success Flag |
data | JSON | Return data |
data.id | int | Avatar ID. |
data.customizedName | String | Avatar name |
data.customizedStatus | int | training status of this avatar. 0:training 1:success 2:failed |
data.reason | String | Reason for failure |
data.defaultConversationId | String | default conversationId of this avatar |