Open app
Moonborn — API · chat

Fetch a chat session by id

GET/v1/chat/sessions/{id}scope · Bearer (API key or session JWT)
Path parameters
FieldTypeDescription
idreqstringChat session id (e.g. `chs_*`).

Responses

200OK
Body
FieldTypeDescription
sessionIdreqstring
orgIdreqstring
workspaceIdreqstring
personaIdreqstring
userIdreqstring
titlereqstring
statusreqstring · "active" | "ended" | "archived"
messageCountreqnumber
inputTokensreqnumber
outputTokensreqnumber
costUsdMicrosreqnumber
startedAtreqstring
lastActiveAtreqstring
endedAtreqstring
401Unauthenticated
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
404Session not found
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

Examples

cURL
curl -X GET https://api.moonborn.co/v1/chat/sessions/<id> \
  -H "Authorization: Bearer $MOONBORN_API_KEY"
TypeScript
import Moonborn from '@moonborn/sdk';

const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });

const result = await client.chat.getChatSession({
  id: '<id>',
});
Python
import os
from moonborn import Moonborn

client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])

result = client.chat.get_chat_session(
    id="<id>",
)