AI 服务/Agent
修改会话
修改会话标题。标题长度为 1-100。
PATCH
/
api
/
agent
/
sessions
/
{sessionId}
修改会话
curl --request PATCH \
--url https://aitoearn.cn/api/agent/sessions/{sessionId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": "Weekend cafe notes"
}
'import requests
url = "https://aitoearn.cn/api/agent/sessions/{sessionId}"
payload = { "title": "Weekend cafe notes" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Weekend cafe notes'})
};
fetch('https://aitoearn.cn/api/agent/sessions/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/agent/sessions/{sessionId}"
payload := strings.NewReader("{\n \"title\": \"Weekend cafe notes\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"id": "string",
"status": "active",
"points": 1,
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"title": "string"
}
}授权
需要从 AiToEarn 获取 API Key。点击前往「API Key 获取教程」。
路径参数
会话 ID。
请求体
application/json
会话标题,长度 1-100。
Required string length:
1 - 100响应
200 - application/json
请求已被服务处理。业务是否成功以响应体 code === 0 为准。
业务状态码。0 表示成功,非 0 表示业务错误。
响应消息。
Hide child attributes
Hide child attributes
会话 ID。
会话状态。active 为进行中,waiting_approval 为等待工具审批,waiting_task 为等待异步任务,waiting_resume 为等待续跑,completed 为已完成,cancelled 为已中止。
可用选项:
active, waiting_approval, waiting_task, waiting_resume, completed, cancelled 该会话累计消耗的积分。
创建时间。
更新时间。
会话标题。新会话标题生成后才会出现。
请求 ID。
错误响应时间戳,Unix 毫秒。
最后修改于 2026年9月24日
⌘I
修改会话
curl --request PATCH \
--url https://aitoearn.cn/api/agent/sessions/{sessionId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": "Weekend cafe notes"
}
'import requests
url = "https://aitoearn.cn/api/agent/sessions/{sessionId}"
payload = { "title": "Weekend cafe notes" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({title: 'Weekend cafe notes'})
};
fetch('https://aitoearn.cn/api/agent/sessions/{sessionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/agent/sessions/{sessionId}"
payload := strings.NewReader("{\n \"title\": \"Weekend cafe notes\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"id": "string",
"status": "active",
"points": 1,
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"title": "string"
}
}
