Session Details
Get an Agent session owned by the account of the current API Key.
curl --request GET \
--url https://aitoearn.cn/api/ai/agent/sessions/{sessionId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/ai/agent/sessions/{sessionId}"
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/{sessionId}', 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/{sessionId}"
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))
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Path Parameters
Session ID.
Response
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
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/{sessionId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/ai/agent/sessions/{sessionId}"
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/{sessionId}', 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/{sessionId}"
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))
}
