步骤说明:① 先建立 WebSocket 连接 → ② 选择一种方式完成认证 → ③ 认证成功后即可调用 chat_bot_v3
连接与重连机制认证成功后,连接期间无需重复认证,可持续发送请求连接断开后需重新建立 WebSocket 连接并重新认证收到 (2004)说明 token 无效或已过期,需重新获取 token 后再重连API Key()永久有效;设备 token()access_token 7天过期,用 refresh_token 换新
{ "socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": { "output_type": "emotion", "emotion_output": "happy" }, "agent_name": "chat_bot_v3" }
chat_bot_v3
agent_action
{ "agent_name": "chat_bot_v3", "mode": "customize", "profile_uuid": "mc20250327a58srl", "character_uuid": "mc20250326a54kf", "tts_model": "MM_TTSL_realtime_speech-01-turbo", "speed": 0, "max_tokens": 100, "emotion_output": true, "session_token": "0886a1f1-cd25-445a-9f3a-767032da9b84", "upload_format": "pcm", "upload_sample_rate": 16000, "language": "auto" }
curl --location 'https://api.mindcraft.com.cn' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "agent_name": "chat_bot_v3", "mode": "customize", "profile_uuid": "mc20250327a58srl", "character_uuid": "mc20250326a54kf", "tts_model": "MM_TTSL_realtime_speech-01-turbo", "speed": 0, "max_tokens": 100, "emotion_output": true, "session_token": "0886a1f1-cd25-445a-9f3a-767032da9b84", "upload_format": "pcm", "upload_sample_rate": 16000, "language": "auto" }'