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/conversationsCreate a new conversation.
bash
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}/messagesSend a message and get an AI response. Supports streaming.
| Parameter | Type | Description |
|---|---|---|
contentRequired | string | Message content (max 32K chars) |
model | string | Model ID override |
provider_preference | string | Force provider |
stream | booleandefault: false | Enable SSE streaming |
bash
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.
bash
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"}'