AI 服务/Agent
中止会话
中止进行中或等待中的 Agent 运行。重复调用是安全的。成功后会话状态变为 cancelled。
POST
中止会话
最后修改于 2026年9月24日
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
中止进行中或等待中的 Agent 运行。重复调用是安全的。成功后会话状态变为 cancelled。
curl --request POST \
--url https://aitoearn.cn/api/agent/sessions/{sessionId}/abort \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/agent/sessions/{sessionId}/abort"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/agent/sessions/{sessionId}/abort', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/agent/sessions/{sessionId}/abort"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request POST \
--url https://aitoearn.cn/api/agent/sessions/{sessionId}/abort \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/agent/sessions/{sessionId}/abort"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/agent/sessions/{sessionId}/abort', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/agent/sessions/{sessionId}/abort"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}