curl --request GET \
--url https://api.synthra.ai/v1/sessions/session_abc123def456 \
--header 'Authorization: Bearer synthra_live_abc123def456'
const response = await fetch(
'https://api.synthra.ai/v1/sessions/session_abc123def456',
{
headers: {
'Authorization': `Bearer ${process.env.SYNTHRA_API_KEY}`
}
}
);
const data = await response.json();
import requests
response = requests.get(
'https://api.synthra.ai/v1/sessions/session_abc123def456',
headers={
'Authorization': f'Bearer {api_key}'
}
)
{
"sessionId": "session_abc123def456",
"userId": "user_9f8e7d6c5b4a",
"createdAt": "2024-03-08T14:30:00Z",
"expiresAt": "2024-03-09T14:30:00Z",
"lastActivity": "2024-03-08T15:45:23Z",
"messageCount": 15,
"tokenUsage": {
"total": 1847,
"prompt": 923,
"completion": 924
},
"metadata": {
"source": "web",
"language": "en"
}
}
{
"error": {
"code": "session_not_found",
"message": "Session does not exist or has expired"
}
}
Session Operations
Get Session
Retrieve session details and statistics
GET
/
v1
/
sessions
/
{sessionId}
curl --request GET \
--url https://api.synthra.ai/v1/sessions/session_abc123def456 \
--header 'Authorization: Bearer synthra_live_abc123def456'
const response = await fetch(
'https://api.synthra.ai/v1/sessions/session_abc123def456',
{
headers: {
'Authorization': `Bearer ${process.env.SYNTHRA_API_KEY}`
}
}
);
const data = await response.json();
import requests
response = requests.get(
'https://api.synthra.ai/v1/sessions/session_abc123def456',
headers={
'Authorization': f'Bearer {api_key}'
}
)
{
"sessionId": "session_abc123def456",
"userId": "user_9f8e7d6c5b4a",
"createdAt": "2024-03-08T14:30:00Z",
"expiresAt": "2024-03-09T14:30:00Z",
"lastActivity": "2024-03-08T15:45:23Z",
"messageCount": 15,
"tokenUsage": {
"total": 1847,
"prompt": 923,
"completion": 924
},
"metadata": {
"source": "web",
"language": "en"
}
}
{
"error": {
"code": "session_not_found",
"message": "Session does not exist or has expired"
}
}
Authorization
Path Parameters
Response
curl --request GET \
--url https://api.synthra.ai/v1/sessions/session_abc123def456 \
--header 'Authorization: Bearer synthra_live_abc123def456'
const response = await fetch(
'https://api.synthra.ai/v1/sessions/session_abc123def456',
{
headers: {
'Authorization': `Bearer ${process.env.SYNTHRA_API_KEY}`
}
}
);
const data = await response.json();
import requests
response = requests.get(
'https://api.synthra.ai/v1/sessions/session_abc123def456',
headers={
'Authorization': f'Bearer {api_key}'
}
)
{
"sessionId": "session_abc123def456",
"userId": "user_9f8e7d6c5b4a",
"createdAt": "2024-03-08T14:30:00Z",
"expiresAt": "2024-03-09T14:30:00Z",
"lastActivity": "2024-03-08T15:45:23Z",
"messageCount": 15,
"tokenUsage": {
"total": 1847,
"prompt": 923,
"completion": 924
},
"metadata": {
"source": "web",
"language": "en"
}
}
{
"error": {
"code": "session_not_found",
"message": "Session does not exist or has expired"
}
}