跳转到主要内容
POST
/
v1
/
realtime
/
leave
停止对话式 Agent
curl --request POST \
  --url https://api.senseaudio.cn/v1/realtime/leave \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "room_id": "lO81loRAfmUMFIwY"
}
'
import requests

url = "https://api.senseaudio.cn/v1/realtime/leave"

payload = { "room_id": "lO81loRAfmUMFIwY" }
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({room_id: 'lO81loRAfmUMFIwY'})
};

fetch('https://api.senseaudio.cn/v1/realtime/leave', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.senseaudio.cn/v1/realtime/leave",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'room_id' => 'lO81loRAfmUMFIwY'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.senseaudio.cn/v1/realtime/leave"

payload := strings.NewReader("{\n \"room_id\": \"lO81loRAfmUMFIwY\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.senseaudio.cn/v1/realtime/leave")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"room_id\": \"lO81loRAfmUMFIwY\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.senseaudio.cn/v1/realtime/leave")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"room_id\": \"lO81loRAfmUMFIwY\"\n}"

response = http.request(request)
puts response.read_body
{}

授权

Authorization
string
header
必填

格式:Bearer <API_KEY>

请求头

Content-Type
string
默认值:application/json
必填

内容类型。固定为 application/json

示例:

"application/json"

请求体

application/json
room_id
string
必填

房间 ID,从「创建对话式 Agent」接口返回值中获取

示例:

"lO81loRAfmUMFIwY"

响应

成功响应,返回空 JSON 对象

成功时返回空 JSON 对象