Command Palette

Search for a command to run...

Core API

Chats

Create chats, continue conversations, and retrieve chat history for your users.

POST/chats

Create a Chat

Create a chat with subject_id, external_user_id, and the first user message. Save the returned chat_id on your side for later continuation.

POST /chatsbash
curl -X POST "https://{{domain}}/api/external/v1/chats" \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: create-chat-001" \
  -d '{
    "subject_id": "<subject_id>",
    "external_user_id": "user-123",
    "message": "Explain equivalent fractions."
  }'
POST/chats/{chatId}/messages

Send the Next Message

Use the canonical messages path for follow-up messages. The legacy POST /chats/{id} path remains supported for compatibility.

POST /chats/{chatId}/messagesbash
curl -X POST "https://{{domain}}/api/external/v1/chats/<chat_id>/messages" \
  -H "Authorization: Bearer <your_api_key>" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: message-001" \
  -d '{
    "message": "Now give me one example."
  }'
GET/chats/{chatId}

Read Chat History

GET /chats/{chatId}bash
curl -X GET "https://{{domain}}/api/external/v1/chats/<chat_id>" \
  -H "Authorization: Bearer <your_api_key>"
Chats | Math AI Docs