from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.conversations.create(metadata={
"session_id": "sess_abc123",
"user_type": "premium",
})
# Handle response
print(res){
"id": "conv_abc123",
"object": "conversation",
"created_at": 1704067200,
"metadata": {
"session_id": "sess_abc123",
"user_type": "premium"
}
}Create a conversation to store and retrieve conversation state across Response API calls.
from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.conversations.create(metadata={
"session_id": "sess_abc123",
"user_type": "premium",
})
# Handle response
print(res){
"id": "conv_abc123",
"object": "conversation",
"created_at": 1704067200,
"metadata": {
"session_id": "sess_abc123",
"user_type": "premium"
}
}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>.
Initial items to include in the conversation context. Max 20 items at a time.
20Input message item: A message with role and content. Use this for user, assistant, system, or developer turns in structured inputs.
Show child attributes
Show child attributes
OK
The unique ID of the conversation
The object type, always 'conversation'
Unix timestamp of when the conversation was created
Show child attributes
Identity of the conversation owner. Either a SHA256 hash or raw userId:externalUserId depending on IDENTITY_MODE.
Was this page helpful?