### StartVoiceChat API Request Example (JSON) Source: https://www.volcengine.com/docs/6348/2123348/index This JSON object demonstrates a complete request payload for the StartVoiceChat API. It includes configurations for ASR, LLM, TTS, and agent behavior, such as target user, welcome message, and burst object settings. ```json { "AppId": "68e*****477", "RoomId": "ChatRoom01", "TaskId": "ChatTask01", "Config": { "ASRConfig": { "Provider": "volcano", "ProviderParams": { "Mode": "bigmodel", "StreamMode": 0 }, "VADConfig": { "SilenceTime": 600, "AIVAD": true }, "InterruptConfig": {} }, "LLMConfig": { "Mode": "ArkV3", "ModelName": "doubao-seed-1-8-251215", "SystemMessages": [ "##人设\n你是一个全能的超级助手,具备强大的知识库、情感理解能力和解决问题的能力。你的目标是高效、专业、友好地帮助用户完成各类任务,包括但不限于日常生活、工作安排、信息检索、学习辅导、创意写作、语言翻译和技术支持等;\n\n##约束\n始终主动、礼貌、有条理;\n回答准确但不冗长,必要时可提供简洁总结+详细解释;\n不清楚的任务会主动澄清,不假设、不误导。" ], "HistoryLength": 10, "ThinkingType": "disabled", "VisionConfig": { "SnapshotConfig": {}, "StorageConfig": { "TosConfig": {} } } }, "TTSConfig": { "Provider": "volcano_bidirection", "ProviderParams": { "Credential": { "ResourceId": "seed-tts-2.0" }, "VolcanoTTSParameters": "{\"req_params\":{\"speaker\":\"ICL_zh_female_wuxi_tob\",\"audio_params\":{\"speech_rate\":0}}}" } }, "SubtitleConfig": {}, "InterruptMode": 0, "FunctionCallingConfig": {}, "WebSearchAgentConfig": {}, "MemoryConfig": {}, "MusicAgentConfig": {} }, "AgentConfig": { "TargetUserId": ["Huoshan01"], "UserId": "ChatBot01", "WelcomeMessage": "我是你的AI助手,有什么需要我为您效劳的吗?", "Burst": { "Enable": false, "BufferSize": 0, "Interval": 0 }, "VoicePrint": { "MetaList": null, "VoicePrintList": null } } } ``` -------------------------------- ### Third-Party LLM/Agent Configuration - System and User Prompts Source: https://www.volcengine.com/docs/6348/2123348/index Defines the system-level instructions and user-provided prompts to guide the behavior and responses of third-party models. SystemMessages set the AI's persona and rules, while UserPrompts enhance response quality. ```javascript { "SystemMessages": ["You are a helpful assistant."], "UserPrompts": [ { "Role": "user", "Content": "What is the weather like today?" }, { "Role": "assistant", "Content": "The weather is sunny." } ] } ``` -------------------------------- ### StartVoiceChat API Response Example (JSON) Source: https://www.volcengine.com/docs/6348/2123348/index This JSON object represents a successful response from the StartVoiceChat API. It includes metadata about the request and a 'Result' field indicating success. ```json { "Result": "ok", "ResponseMetadata": { "RequestId": "202512****10420", "Action": "StartVoiceChat", "Version": "2025-06-01", "Service": "rtc", "Region": "cn-north-1" } } ``` -------------------------------- ### Coze Custom Parameters Configuration Source: https://www.volcengine.com/docs/6348/2123348/index Enables dynamic assignment of values to custom parameters defined in the Coze conversation flow's starting node. This is applicable for published APIs and single-agent ChatSDK modes. ```json { "custom_param_1": "some_value", "custom_param_2": 123 } ``` -------------------------------- ### Volcengine Agent Basic Configuration Source: https://www.volcengine.com/docs/6348/2123348/index Configure essential agent settings, including the target user ID, welcome message, agent ID, and callback settings for conversation state. ```json { "TargetUserId": ["user1"], "WelcomeMessage": "Hello", "UserId": "BotName001", "EnableConversationStateCallback": false } ``` -------------------------------- ### Volcengine License User Configuration Source: https://www.volcengine.com/docs/6348/2123348/index Configure settings for license users, indicating whether a license is in use. ```json { "UseLicense": true } ``` -------------------------------- ### Configure Voice Cloning (Non-Streaming) (JSON) Source: https://www.volcengine.com/docs/6348/2123348/index This configuration is for Volcano Engine's voice cloning service with non-streaming input and output. It simplifies setup by encapsulating common parameters and requires specifying the voice type, cluster ID, and model version. ```json { "audio": { "voice_type": "S_U****ft1" }, "app": { "cluster": "volcano_icl" } } ``` -------------------------------- ### Third-Party LLM/Agent Configuration - Generation Parameters Source: https://www.volcengine.com/docs/6348/2123348/index Optional parameters for controlling the output of third-party Large Models/Agents. MaxTokens limits output length, Temperature adjusts randomness, and TopP controls token diversity. ```javascript { "ModelName": "name1", "MaxTokens": 1024, "Temperature": 0.1, "TopP": 0.3 } ``` -------------------------------- ### StartVoiceChat Configuration Source: https://www.volcengine.com/docs/6348/2123348/index This section outlines the various configuration options available for the StartVoiceChat API, including ASR, VAD, and TTS settings. ```APIDOC ## StartVoiceChat API ### Description This API enables real-time voice chat with AI models, supporting various configurations for speech recognition, voice activity detection, and text-to-speech. ### Method POST ### Endpoint /websites/volcengine_6348_2123348 ### Parameters #### Request Body - **context** (String) - Optional - Specifies hotwords to improve ASR accuracy. Format: JSON string. Max length: 200 tokens. - **context_history_length** (Integer) - Optional - Number of recent conversation turns to include for context. Range: [0, 20]. Default: 0. - **火山流式语音识别(小模型)** (Object) - Volcanic streaming ASR model configuration. - **Mode** (String) - Required - Model type. Fixed value: 'smallmodel'. - **Cluster** (String) - Required - Cluster ID for the ASR model. Example: 'volcengine_streaming_common'. - **自定义语音识别** (Object) - Custom ASR model configuration. - **URL** (String) - Required - Gateway service access point URL. Format: 'wss://ai-gateway.vei.volces.com/v1/realtime?model='. - **APIKey** (String) - Required - Gateway access key. Example: 'sk-xxxxxx'. - **ExtraData** (JSONMap) - Optional - Custom parameters passed to the ASR service. - **VADConfig** (Object) - Optional - Voice Activity Detection configuration. - **SilenceTime** (Integer) - Optional - Silence duration for sentence end detection. Range: [500, 3000) ms. Default: 600. - **AIVAD** (Boolean) - Optional - Enable AI-semantic sentence segmentation. Default: false. - **VolumeGain** (Float) - Optional - Volume gain value. Default: 1.0, Recommended: 0.3. - **InterruptConfig** (Object) - Optional - Speech interruption configuration. - **InterruptSpeechDuration** (Integer) - Optional - Automatic interruption threshold based on speech duration. Range: 0 or [200, 3000] ms. Default: 0. - **InterruptKeywords** (String[]) - Optional - List of keywords to trigger interruption. - **TurnDetectionMode** (Integer) - Optional - Whether to automatically trigger a new conversation round. 0: Auto-trigger (default), 1: Manual trigger. - **TTSConfig** (Object) - Required - Text-to-Speech configuration. - **Provider** (String) - Required - TTS service provider. Options: 'volcano_bidirection', 'volcano', 'minimax', 'ai_gateway'. - **ProviderParams** (Object) - Required - Parameters for the selected TTS provider. - **火山语音合成大模型(流式输入流式输出_参数透传)**: - **Credential** (Object) - Optional - TTS model version credential. - **ResourceId** (String) - Optional - TTS model version. Options: 'seed-tts-1.0' or 'volc.service_type.10029' (default), 'seed-tts-2.0'. - **VolcanoTTSParameters** (String) - Required - JSON string for Volcanic TTS native API parameters. Must include 'req_params.speaker'. - **火山语音合成大模型(流式输入流式输出_参数直传)**: - **ResourceId** (String) - Optional - TTS model version. Options: 'seed-tts-1.0' or 'volc.service_type.10029' (default), 'seed-tts-2.0'. - **audio** (Object) - Required - Audio configuration for Volcanic TTS. - **voice_type** (String) - Required - Voice type, must match ResourceId. Example: 'zh_female_linjianvhai_moon_bigtts'. - **speech_rate** (Integer) - Optional - Speech rate. Range: [-50, 100]. Default: 0. ### Request Example ```json { "context": "{\"hotwords\": [{\"word\": \"CO2\"},{\"word\": \"雨伞\"},{\"word\": \"鱼\"}]}", "context_history_length": 2, "火山流式语音识别(小模型)": { "Mode": "smallmodel", "Cluster": "volcengine_streaming_common" }, "TTSConfig": { "Provider": "volcano_bidirection", "ProviderParams": { "火山语音合成大模型(流式输入流式输出_参数透传)": { "VolcanoTTSParameters": "{\"req_params\":{\"speaker\":\"zh_female_linjianvhai_moon_bigtts\", \"audio_params\": { \"speech_rate\": 100 }}}" } } } } ``` ### Response #### Success Response (200) - **Response structure will vary based on the streaming nature of the service and specific configurations.** #### Response Example ```json { "text": "Received your request.", "audio_stream": "