Session List
List Agent sessions for the account that owns the current API Key.
curl --request GET \
--url https://aitoearn.cn/api/ai/agent/sessions \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/ai/agent/sessions"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/ai/agent/sessions', 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/ai/agent/sessions"
req, _ := http.NewRequest("GET", 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))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"page": 1,
"pageSize": 1,
"totalPages": 1,
"total": 1,
"list": [
{
"id": "string",
"status": "active",
"points": 1,
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"title": "string"
}
]
}
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Query Parameters
Page number, starting from 1.
x >= 1Items per page, from 1 to 1000.
1 <= x <= 1000Search by session title. Length 1-200.
1 - 200Response
The request has been processed by the service. Business success is determined by whether the response body has code === 0.
Business status code. 0 means success; non-zero means a business error.
Response message.
Hide child attributes
Hide child attributes
Current page number.
Items per page.
Total pages.
Total item count.
Data list.
Hide child attributes
Hide child attributes
Session ID.
Session status. active means running, waiting_approval means waiting for tool approval, waiting_task means waiting for an async task, waiting_resume means waiting to resume, completed means finished, and cancelled means aborted.
active, waiting_approval, waiting_task, waiting_resume, completed, cancelled Credits consumed by this session.
Created at.
Updated at.
Session title. It appears after the title is generated for a new session.
Request ID.
Error response timestamp in Unix milliseconds.
curl --request GET \
--url https://aitoearn.cn/api/ai/agent/sessions \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/ai/agent/sessions"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/ai/agent/sessions', 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/ai/agent/sessions"
req, _ := http.NewRequest("GET", 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))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"page": 1,
"pageSize": 1,
"totalPages": 1,
"total": 1,
"list": [
{
"id": "string",
"status": "active",
"points": 1,
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"title": "string"
}
]
}
}
