Skip to main content
GET
/
api
/
v1
/
llm
/
conversations
Python (SDK)
from mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.conversations.list(after="conv_abc123", limit=20, order="desc", metadata={
        "user_type": "premium",
    }, search="weather forecast")

    # Handle response
    print(res)
{
  "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

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

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