Base URL
Authentication
All requests require anapikey query parameter.
Endpoints Overview
| Endpoint | Method | Description |
|---|---|---|
/api/chat/sessions | GET | List chat sessions for a project with optional filters |
/api/chat/sessions/{sessionId} | GET | Get details for a single chat session |
/api/chat/messages | GET | List messages for a specific chat session |
List Chat Sessions
Retrieve a paginated list of chat sessions for a project.Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apikey | string | Yes | Project API key used for authentication |
startTime | string | No | Start time in UTC, format yyyy-MM-dd HH:mm:ss |
endTime | string | No | End time in UTC, format yyyy-MM-dd HH:mm:ss |
status | integer | No | Session status: 0=active, 1=completed, 2=failed |
limit | integer | No | Maximum records to return. Default 20, maximum 100 |
cursor | string | No | Pagination cursor for the next page |
Response Example
Results are ordered by
startTime ascending, then by id ascending. videoUrl is null when no video was generated for the session.Get Single Chat Session
Retrieve detailed information for a specific session.Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | Session identifier in UUID format |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apikey | string | Yes | Project API key used for authentication |
Response Example
This endpoint returns the session object directly in
data, not in a nested data.data array.List Chat Messages
Retrieve messages for a specific chat session with optional filtering and pagination.Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
apikey | string | Yes | Project API key used for authentication |
sessionId | string | Yes | Session identifier in UUID format |
startTime | string | No | Start time in UTC, format yyyy-MM-dd HH:mm:ss |
endTime | string | No | End time in UTC, format yyyy-MM-dd HH:mm:ss |
role | integer | No | Message role filter: 0=user, 1=AI/assistant |
limit | integer | No | Maximum records to return. Default 50, maximum 200 |
cursor | string | No | Pagination cursor for the next page |
Response Example
Message Fields
| Field | Type | Description |
|---|---|---|
id | string | Message UUID |
role | integer | 0=user, 1=AI/assistant |
messageType | integer | Message type. Current value is 0 for text |
content | string | Plain-text message content |
createdAt | string | Message time in yyyy-MM-dd HH:mm:ss format |
Messages are ordered by
createdAt ascending, then by id ascending.Usage Guide
List sessions
Call
GET /api/chat/sessions to retrieve sessions for your project. Use startTime, endTime, and status to narrow the result set.Inspect a session
Use the returned session
id as sessionId in GET /api/chat/sessions/{sessionId} when you need session-level details.Fetch messages
Call
GET /api/chat/messages with sessionId to retrieve the conversation history. Use role if you only need user or assistant messages.Paginate with nextCursor
For both list endpoints, omit
cursor on the first request. On subsequent requests, pass the previous nextCursor until it is empty or null.Error Handling
| Code | Meaning |
|---|---|
400 | Invalid API key or missing required parameters |
403 | API key expired or project not active |
404 | Session not found or does not belong to the project |
500 | Internal server error |
Security Notes
- Never expose your API key in browser-side code.
- API keys are project-scoped and can expire.
- Send all requests over HTTPS.
- Rotate keys regularly.
- Monitor usage for abnormal traffic patterns.