Skip to main content

OpenAPI Integration

Base URL: https://app.duix.ai/

1. Prerequisites

Generate Signature and Obtain Token

When integrating with the duix-openapi-v2 platform, you must generate access tokens in your own backend.
Refer to the token guide for implementation details:
How to Get Token

2. Management Interfaces

All management endpoints require a valid token in the HTTP request header.

Interaction Flow

Interaction Flow

2.1 Get App Real-Time Concurrency

Endpoint: /duix-openapi-v2/sdk/v2/getconcurrentNumber
Method: GET
Description: Retrieve the real-time concurrency status of an application.

Parameters

NameTypeLocationDescription
appIdStringQueryApplication ID created on the Duix platform

Response

NameTypeDescription
codeStringResponse code
dataConcurrentStatusConcurrency details
cropIdStringCorporate ID
totalConcurrentNumberintegerTotal concurrent sessions
userConcurrentNumberintegerUser-specific concurrent sessions
messageStringResponse message
successbooleanRequest status

Example Response

{
  "code": "",
  "data": {
    "cropId": "",
    "totalConcurrentNumber": 0,
    "userConcurrentNumber": 0
  },
  "message": "",
  "success": true
}

Get app real-time sessions

Endpoint
/duix-openapi-v2/sdk/v2/getconcurrentList
Request Method: GET
Description Retrieve a list of all active (in-call) sessions for an app.
Parameters
Parameter NameTypePass MethodParameter Description
appIdStringQueryAPPID created on the Duix platform

Close all sessions for an app

Endpoint
/duix-openapi-v2/sdk/v2/distroyCallSessionsByAppId
Request Method: GET
Description Terminate all active sessions for a specific app.
Parameters
Parameter NameTypePass MethodParameter Description
appIdStringQueryAPPID created on the Duix platform
Example Response
{
  "code": "",
  "data": "",
  "message": "",
  "success": true
}

Close a specific session

Endpoint
/duix-openapi-v2/sdk/v2/sessionStop
Request Method: GET
Parameters
Parameter NameTypePass MethodParameter Description
uuidStringQuerysessionId returned in the start-complete event

Third-Party Dialog Integration (Non-Streaming)

Integrate your own dialog system with Duix using a webhook-based POST approach.
The Duix platform will send user questions to your defined remote URL and expect a structured JSON response.
Integration diagram
Example:
Refer to the open-source demo for a simple integration reference.

Request

The Duix platform sends each user question as a POST request to your remote endpoint using the format below.
Request Parameters
FieldTypeDescriptionRequired
sidStringUser ID generated during account creation (visible in account info).Y
dh-codeStringDigital human code, unique per digital human (viewable in the avatar overview).Y
dh-questionStringThe user’s question text.Y
dh-conversation-idStringConversation ID — unique identifier for the session.Y
dh-contextStringConversation context, formatted as a stringified JSON object.N
dh-context.q.contextStringPrevious user question text (context).N
dh-context.a.contextStringPrevious digital human answer text (context).N
uuidStringRequest ID used for tracking and troubleshooting.N
Example Request
{
  "sid": "100003",
  "dh-code": "187265485019156480",
  "dh-question": "Who are you?",
  "dh-conversation-id": "0513e935-041f-48e0-9330-652ef4194511",
  "dh-context": [
    {
      "q": { "context": "user question" },
      "a": { "context": "answer" }
    }
  ]
}

Response: Reply using the format below.
FieldTypeRequiredDescription
codeStringYResponse status code
msgStringNOptional success or error message
dataobjectNData payload (see below)
successBooleanYWhether the request succeeded
Valid response codes
CodeStatusResponse
200OKSuccessful response
400Bad RequestInvalid body or headers
401UnauthorizedInvalid authentication token
403ForbiddenAuthentication failed
500Server ErrorService exception
Response body
FieldTypeDescriptionRequired
conversationIdStringConversation ID (matches the dh-conversation-id in the request).Y
questionStringThe user’s question.N
answerStringThe digital human’s response, as a stringified JSON object.Y
errorMsgStringDescription of any exception or errorN
Example Response
{
  "code": "200",
  "msg": "SUCCESS",
  "success": true,
  "data": {
    "conversationId": "0513e935-041f-48e0-9330-652ef4194511",
    "question": "who are you?",
    "answer": {
      "answer": "Welcome to UneeQ, how can I help?"
    },
    "errorMsg": ""
  }
}
Expected response time: Digital human interactions are latency‑sensitive. 95% of requests should complete within 20 seconds. If the response exceeds 20s, a timeout is reported, but the digital human will continue processing and respond once available.

Third-Party Dialog Integration (Streaming)

In streaming mode, Duix delivers incremental responses to your remote endpoint in real time as the digital human speaks.
This allows you to display or process partial answers before the full response completes.
Streaming integration diagram
Example:
Refer to the open-source demo for a simple streaming integration example.

Request

The Duix platform sends each user question to your remote URL via an HTTP POST request in the following format.
Parameters
FieldTypeDescriptionRequired
sidStringUser ID generated during user creation (visible in account information).Y
dh-codeStringDigital human code, unique per digital human (viewable in the avatar overview).Y
dh-questionStringThe question text sent by the user.Y
dh-conversation-idStringUnique identifier for the conversation.Y
dh-contextStringConversation context as a stringified JSON object.N
dh-context.q.contextStringPrevious question text in the conversation context.N
dh-context.a.contextStringPrevious answer text in the conversation context.N
uuidStringRequest ID for tracking and debugging purposes.N
Example Request
{
  "sid": "100003",
  "dh-code": "187265485019156480",
  "dh-question": "Who are you?",
  "dh-conversation-id": "0513e935-041f-48e0-9330-652ef4194511",
  "dh-context": [
    {
      "q": { "context": "user question" },
      "a": { "context": "answer" }
    }
  ]
}



Response body

| Field  | Type   | Description | Required |
| ------ | ------ | ----------- | -------- |
| answer | String | Partial or complete answer returned by the digital human | Y        |
| isEnd  | boolean | Indicates whether the current response is the final one | Y        |

Example Response

```json
{
    "answer": "Let the Cowherd and Weaver Girl meet on the Milky Way.",
    "isEnd": false
}
Expected response time: Digital human interactions are latency‑sensitive. 95% of requests should complete within 20 seconds. If the response exceeds 20s, a timeout is reported, but the digital human will continue to respond.

Get Conversation Details

Retrieve detailed configuration and metadata for a specific conversation on the Duix platform.

Endpoint

/duix-openapi-v2/sdk/getConversationById?conversationId=[conversation_id]

Method

GET

Description

Query conversation details by providing the conversation ID obtained from the Duix platform.

Parameters

NameTypeLocationDescription
conversationIdStringQueryUnique conversation ID generated by the Duix platform

Response

FieldTypeDescription
codeStringResponse code
dataJSONMain conversation data
detailDtoJSONConversation resource details (includes model, background, and TTS configuration)
detailDto.backgroundDtoJSONBackground resource details
detailDto.modelIdStringModel ID
detailDto.modelNameStringModel name
detailDto.modelIdTypeStringModel type (0 = Cloud Digital Human, 1 = Local Digital Human)
detailDto.localModelInfoJSONLocal digital human information
detailDto.backgroundDto.backgroundUrlStringBackground image or video URL
scriptDtoListJSONPredefined dialog scripts
scriptDtoList.scriptTypeStringScript type (0: Wake-up Word, 1: Opening Line, 2: Waiting Phrase, 3: Unknown Question, 4: Farewell, 5: Interruption, 6: Interruption Sentence, 7: Guiding Phrase)
scriptDtoList.scriptContentStringScript text
scriptDtoList.ttsContentStringScript audio file URL
messageStringText message returned by the API
successBooleanRequest success flag

Example Response

{
	"success": true,
	"code": "0",
	"message": "SUCCESS",
	"msg": "SUCCESS",
	"data": {
		"id": "108",
		"conversationName": "Unnamed-18:04",
		"language": "zh",
		"corpId": "1003645",
		"userId": "3959",
		"conversationConfigDto": null,
		"maxConversation": 2,
		"dataModelIsUsed": 1,
		"knowledgeIsUsed": 1,
		"fileIsUsed": 0,
		"thirdIsUsed": 0,
		"isFreedom": 0,
		"asrProvider": null,
		"conversationInfoDto": {
			"id": 109,
			"name": "1",
			"nickName": "",
			"gender": 1,
			"age": 0,
			"height": 0,
			"weight": 0,
			"characters": "",
			"backStory": ""
		},
		"detailDto": {
			"id": 95,
			"conversationId": "108",
			"proportion": "16:9",
			"terminalType": 0,
			"modelId": "321486924406853",
			"modelIdType": 0,
			"imageId": null,
			"sceneId": null,
			"modelName": "Model name",
			"sceneType": 0,
			"background": 1,
			"backgroundDto": {
				"id": 1,
				"backgroundCode": "1591003727513522176",
				"backgroundName": "zuoyi.jpg",
				"backgroundUrl": "/video-server/jpg/1592809647136509954.jpg",
				"fileType": 0,
				"proportion": "16:9",
				"userId": null
			},
			"modelConfig": null,
			"ttsId": "15",
			"ttsName": "guina",
			"ttsConfig": null,
			"ttsUrl": "",
			"ttsVolume": 0,
			"ttsSpeaker": "zhifeng_emo",
			"ttsSpeedRate": 0,
			"ttsPitch": 0,
			"ttsSource": 20,
			"samplePictureUrl": "/model/2023/02/06/c5348a17fac75feb0152a0c599b7af87.png",
			"videoWidth": 1920,
			"videoHeight": 1920,
			"humanProportion": "9:16",
			"humanWidth": 540,
			"humanHeight": 960,
			"humanX": 690,
			"humanY": 120,
			"localModelInfo": null
		},
		"knowledgeDtoList": [],
		"kbConversationDto": null,
		"modelDtoList": [
			{
				"id": 487,
				"conversationId": "108",
				"largeModelType": 0,
				"modelCode": 0,
				"largeName": "chatbot_law",
				"modelId": "1",
				"prompt": "Task: Your name is Zhang San, a real celebrity with a mischievous tone, humor, and a love for joking. Chatting with fans and friends, generating content replies in an oral style. \Requirements for generation: 1. Use my own name, 2. Meet the persona, 3. Prohibit the generation of English content, all must be generated in Chinese. 4. Within 30 words.",
				"botUrl": ""
			}
		],
		"thirdDto": null,
		"scriptDtoList": [
			{
				"id": 2728,
				"conversationId": "108",
				"scriptType": 0,
				"scriptContent": "Els silvrants",
				"ttsContent": null,
				"emotion": "0"
			},
			{
				"id": 2729,
				"conversationId": "108",
				"scriptType": 1,
				"scriptContent": "Hello, welcome to Duix",
				"ttsContent": "https://digital-public-dev.obs.cn-east-3.myhuaweicloud.com/tts-proxy/2024-02-20/1800-_-633043663081836544--FC34641E6EB0A22404C845E219904E81.wav",
				"emotion": "0"
			},
			{
				"id": 2730,
				"conversationId": "108",
				"scriptType": 2,
				"scriptContent": "Wait a moment, I'll think about it",
				"ttsContent": "https://digital-public-dev.obs.cn-east-3.myhuaweicloud.com/tts-proxy/2024-02-20/1630-_-633043667485855744--3F501A3CA51F4DFAFBACE254DD2E3E32.wav",
				"emotion": "0"
			},
			{
				"id": 2731,
				"conversationId": "108",
				"scriptType": 3,
				"scriptContent": "Sorry, I don't quite understand what you mean",
				"ttsContent": "https://digital-public-dev.obs.cn-east-3.myhuaweicloud.com/tts-proxy/2024-02-20/2300-_-633043669830471680--2C5A656A6FBEA2CE09037F21F3DF8434.wav",
				"emotion": "0"
			},
			{
				"id": 2732,
				"conversationId": "108",
				"scriptType": 4,
				"scriptContent": "Sorry, I don't quite understand what you mean",
				"ttsContent": "https://digital-public-dev.obs.cn-east-3.myhuaweicloud.com/tts-proxy/2024-02-20/560-_-633043672326082560--051995577E5C4B5818F952C04A7997E2.wav",
				"emotion": "0"
			},
			{
				"id": 2733,
				"conversationId": "108",
				"scriptType": 5,
				"scriptContent": "Stop talking",
				"ttsContent": null,
				"emotion": "0"
			},
			{
				"id": 2734,
				"conversationId": "108",
				"scriptType": 6,
				"scriptContent": "Okay, you can speak first",
				"ttsContent": "https://digital-public-dev.obs.cn-east-3.myhuaweicloud.com/tts-proxy/2024-02-20/1600-_-633043674196742144--FC70FD95B50E8CEC9D9151905AE13F7F.wav",
				"emotion": "0"
			},
			{
				"id": 2735,
				"conversationId": "108",
				"scriptType": 7,
				"scriptContent": "What is a digital person",
				"ttsContent": "https://digital-public-dev.obs.cn-east-3.myhuaweicloud.com/tts-proxy/2024-02-20/1080-_-633043676541358080--414A4CBCE8B52677F05DAECFD1437BD0.wav",
				"emotion": "0"
			}
		]
	}
}

Create Avatar

Create an AI avatar

Endpoint

/duix-openapi-v2/sdk/v2/createAvatar

Method

POST

Description

This endpoint create an AI avatar.

Parameters

NameTypeLocationDescriptionRequired
ttsNameStringBodyTTS name, select the public TTS voice. See at Settings -> Avatar creator -> Select voiceY
conversationIdStringBodyThe conversation ID. Value is required when using public AI avatar Get Conversation IDN
coverImageStringBodyA value is needed if you are using images to customize your AI avatar. Base64 format, example:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA…N
defaultSpeakingLanguageStringBodyDefault speaking language. default EnglishN
greetingsStringBodyEnter a greeting for your AI avatar’s first words, If not, the system will generate it randomlyN
nameStringBodyThe name of AI avatar. If not, the system will generate it randomlyN
profileStringBodyEnter a description of personality and preferences you’d love your AI avatar to have.. If not, the system will generate it randomlyN

Response

FieldTypeDescription
codeStringResponse code.
msgStringResponse message.
successBooleanIndicates whether the request succeeded.
dataJSONResponse payload containing avatar details.
data.taskIdStringThe task ID of create AI avatar.

Example Response

{
  "code": "0",
  "msg": "SUCCESS",
  "success": true,
  "data": {
      "taskId": "00000184-1934-0eef-2f5e-c58ab9e3406c"
  }
}

Query Avatar

Retrieve information about the creation of an AI avatar using its unique taskId.

Endpoint

/duix-openapi-v2/sdk/v2/queryAvatar

Method

GET

Description

This endpoint returns metadata and training status for an AI avatar previously created through the API.

Parameters

NameTypeLocationDescriptionRequired
taskIdIntegerQueryUnique task ID returned by the createAvatar API.Y

Response

FieldTypeDescription
codeStringResponse code.
msgStringResponse message.
successBooleanIndicates whether the request succeeded.
dataJSONResponse payload containing avatar details.
data.nameStringAvatar name.
data.modelSceneIdStringThe avatar model scene ID.
data.conversationIdStringConversation ID associated with this avatar.
data.coverImageStringThe avatar cover image
data.statusIntegerAvatar training status (0: training, 1: failed, 2: success).
data.processingStepStringTraining progress(preparing, processing, after_processing, done)

Example Response

{
  "code": "0",
  "msg": "SUCCESS",
  "success": true,
  "data": {
      "name": "Khalid Hassan",
      "modelSceneId": "735917732520006",
      "conversationId": "1983775419508027393",
      "coverImage": "https://xxx.xxx.xxx/image/img_3076d14.png",
      "status": 2,
      "processingStep": "done"
  }
}