Skip to main content
GET
/
api
/
v1
/
llm
/
conversations
Typescript (SDK)
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"
}

Authorizations

Authorization
string
header
required

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.

Headers

X-On-Behalf-Of
string

Optional external user identifier for multi-user server-side integrations. Use this when acting on behalf of one of your end users.

Query Parameters

after
string

Conversation ID to list conversations after (pagination cursor)

Example:

"conv_abc123"

limit
integer
default:20

Max number of conversations to return (1-50, default 20)

Required range: 1 <= x <= 50
Example:

20

order
enum<string>
default:asc

Sort order by last updated timestamp: asc (oldest first) or desc (newest first)

Available options:
asc,
desc
Example:

"desc"

metadata

Filter conversations by metadata key-value pairs (JSON string or object). Only conversations with matching metadata will be returned.

Example:
{ "user_type": "premium" }

Search query to find conversations by content. Uses full-text search across conversation items.

Example:

"weather forecast"

Response

200 - application/json

OK

object
any
required
data
object[]
required

Array of conversations

has_more
boolean
required

Whether there are more conversations

last_id
string

ID of the last conversation in the current page