import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.conversations.list({
after: "conv_abc123",
order: "desc",
metadata: {
"user_type": "premium",
},
search: "weather forecast",
});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "conv_abc123",
"object": "conversation",
"created_at": 1704067200,
"metadata": {
"session_id": "sess_abc123",
"user_type": "premium"
}
}
],
"has_more": false,
"last_id": "conv_abc123"
}List all conversations for the authenticated user with pagination support.
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.conversations.list({
after: "conv_abc123",
order: "desc",
metadata: {
"user_type": "premium",
},
search: "weather forecast",
});
console.log(result);
}
run();{
"object": "list",
"data": [
{
"id": "conv_abc123",
"object": "conversation",
"created_at": 1704067200,
"metadata": {
"session_id": "sess_abc123",
"user_type": "premium"
}
}
],
"has_more": false,
"last_id": "conv_abc123"
}Authenticate with your MKA1 API key at the API gateway: Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, also send X-On-Behalf-Of to identify the end user making the request.
Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.
Conversation ID to list conversations after (pagination cursor)
"conv_abc123"
Max number of conversations to return (1-50, default 20)
1 <= x <= 5020
Sort order by last updated timestamp: asc (oldest first) or desc (newest first)
asc, desc "desc"
Filter conversations by metadata key-value pairs (JSON string or object). Only conversations with matching metadata will be returned.
{ "user_type": "premium" }Search query to find conversations by content. Uses full-text search across conversation items.
"weather forecast"
Was this page helpful?