Conversations API

Manage conversations and messages. Use the conversation endpoint for multi-turn chats with history.

Auth: All conversations endpoints accept JWT (from the web UI) or API key (from external apps).
POST/v1/conversations

Create a new conversation.

curl -X POST https://api.aivorylabs.in/v1/conversations \
  -H "Authorization: Bearer YOUR_JWT_OR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My Chat",
    "model": "groq/llama-3.3-70b-versatile",
    "provider": "groq"
  }'
POST/v1/conversations/{id}/messages

Send a message and get an AI response. Supports streaming.

ParameterTypeDescription
contentRequiredstringMessage content (max 32K chars)
modelstringModel ID override
provider_preferencestringForce provider
streambooleandefault: falseEnable SSE streaming
curl -X POST https://api.aivorylabs.in/v1/conversations/CONV_ID/messages \
  -H "Authorization: Bearer YOUR_JWT_OR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Hello, how are you?",
    "model": "groq/llama-3.3-70b-versatile",
    "stream": true
  }'
PATCH/v1/conversations/{id}/messages/{msg_id}

Edit a user message's content. Deletes all subsequent messages so the conversation stays consistent.

curl -X PATCH https://api.aivorylabs.in/v1/conversations/CONV_ID/messages/MSG_ID \
  -H "Authorization: Bearer YOUR_JWT_OR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content": "Updated message content"}'