curl "https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_..."
const response = await fetch(
'https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50',
{ headers: { 'Authorization': 'Bearer sk_live_...' } },
);
const { data, has_more, next_cursor } = await response.json();
import requests
response = requests.get(
'https://api.bota.dev/v1/ask/sessions/as_abc123/messages',
headers={'Authorization': 'Bearer sk_live_...'},
params={'limit': 50},
)
messages = response.json()['data']
{
"data": [
{
"id": "msg_111",
"role": "user",
"content": "What did I commit to this week?",
"parts": [{ "type": "text", "text": "What did I commit to this week?" }],
"tokens": { "input": null, "output": null, "cached": null },
"model": null,
"provider": null,
"finish_reason": null,
"created_at": "2026-05-20T10:23:40Z"
},
{
"id": "msg_222",
"role": "assistant",
"content": "You agreed to send the budget draft by Friday.",
"parts": [
{ "type": "text", "text": "You agreed to send the budget draft by Friday." },
{ "type": "citation", "recording_id": "rec_ghi789", "start_ms": 754000 }
],
"tokens": { "input": 1240, "output": 32, "cached": 0 },
"model": "gemini-2.0-flash",
"provider": "gemini",
"finish_reason": "stop",
"created_at": "2026-05-20T10:23:45Z"
}
],
"has_more": false,
"next_cursor": null
}
AI Ask
List Messages
Retrieve a session’s messages in chronological order
GET
/
ask
/
sessions
/
{id}
/
messages
curl "https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_..."
const response = await fetch(
'https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50',
{ headers: { 'Authorization': 'Bearer sk_live_...' } },
);
const { data, has_more, next_cursor } = await response.json();
import requests
response = requests.get(
'https://api.bota.dev/v1/ask/sessions/as_abc123/messages',
headers={'Authorization': 'Bearer sk_live_...'},
params={'limit': 50},
)
messages = response.json()['data']
{
"data": [
{
"id": "msg_111",
"role": "user",
"content": "What did I commit to this week?",
"parts": [{ "type": "text", "text": "What did I commit to this week?" }],
"tokens": { "input": null, "output": null, "cached": null },
"model": null,
"provider": null,
"finish_reason": null,
"created_at": "2026-05-20T10:23:40Z"
},
{
"id": "msg_222",
"role": "assistant",
"content": "You agreed to send the budget draft by Friday.",
"parts": [
{ "type": "text", "text": "You agreed to send the budget draft by Friday." },
{ "type": "citation", "recording_id": "rec_ghi789", "start_ms": 754000 }
],
"tokens": { "input": 1240, "output": 32, "cached": 0 },
"model": "gemini-2.0-flash",
"provider": "gemini",
"finish_reason": "stop",
"created_at": "2026-05-20T10:23:45Z"
}
],
"has_more": false,
"next_cursor": null
}
Retrieve a session’s messages, oldest first. Assistant messages carry
citation parts that deep-link to a recording_id + start_ms.
Authentication
Requires an API key. The session is looked up within the key’s project; an unknown session returns404. An end-user-scoped key can only read its own sessions.
curl "https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50" \
-H "Authorization: Bearer sk_live_..."
const response = await fetch(
'https://api.bota.dev/v1/ask/sessions/as_abc123/messages?limit=50',
{ headers: { 'Authorization': 'Bearer sk_live_...' } },
);
const { data, has_more, next_cursor } = await response.json();
import requests
response = requests.get(
'https://api.bota.dev/v1/ask/sessions/as_abc123/messages',
headers={'Authorization': 'Bearer sk_live_...'},
params={'limit': 50},
)
messages = response.json()['data']
Path Parameters
string
required
Session identifier (
as_*).Query Parameters
integer
default:"20"
Maximum number of messages to return (1–100).
string
Pagination cursor from a previous response’s
next_cursor.Response
Returns a paginated list of messages, oldest first.{
"data": [
{
"id": "msg_111",
"role": "user",
"content": "What did I commit to this week?",
"parts": [{ "type": "text", "text": "What did I commit to this week?" }],
"tokens": { "input": null, "output": null, "cached": null },
"model": null,
"provider": null,
"finish_reason": null,
"created_at": "2026-05-20T10:23:40Z"
},
{
"id": "msg_222",
"role": "assistant",
"content": "You agreed to send the budget draft by Friday.",
"parts": [
{ "type": "text", "text": "You agreed to send the budget draft by Friday." },
{ "type": "citation", "recording_id": "rec_ghi789", "start_ms": 754000 }
],
"tokens": { "input": 1240, "output": 32, "cached": 0 },
"model": "gemini-2.0-flash",
"provider": "gemini",
"finish_reason": "stop",
"created_at": "2026-05-20T10:23:45Z"
}
],
"has_more": false,
"next_cursor": null
}
Message Fields
| Field | Type | Description |
|---|---|---|
role | string | user or assistant |
content | string | Plain-text message content |
parts | array | Rich content: text segments and (assistant only) citation parts ({ type, recording_id, start_ms }) |
tokens | object | Token usage { input, output, cached }; null for user messages |
model / provider | string | null | The model and provider that produced an assistant message |
finish_reason | string | null | Why generation stopped (assistant only) |
created_at | string | Timestamp |
Was this page helpful?
⌘I

