Chat History
Manage persistent chat conversations
Overview
Store and manage chat conversations across sessions.
Authentication: API Key or OAuth token
Required Scopes (OAuth): chats:read, chats:write
List Chats
Get all saved conversations.
Endpoint: GET /api/v1/chats
const response = await fetch('https://hypery.ai/api/v1/chats', {
headers: {
'Authorization': `Bearer ${apiKey}`
}
})
const { chats } = await response.json()response = requests.get(
'https://hypery.ai/api/v1/chats',
headers={'Authorization': f'Bearer {api_key}'}
)
chats = response.json()['chats']curl https://hypery.ai/api/v1/chats \
-H "Authorization: Bearer YOUR_API_KEY"Response:
{
"success": true,
"chats": [
{
"id": "chat_123",
"title": "Product Ideas Discussion",
"lastMessage": "That's a great idea!",
"messageCount": 15,
"createdAt": "2025-11-16T10:00:00Z",
"updatedAt": "2025-11-16T10:30:00Z"
}
]
}Create Chat
Start a new conversation.
Endpoint: POST /api/v1/chats
const response = await fetch('https://hypery.ai/api/v1/chats', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'New Conversation'
})
})
const { chat } = await response.json()response = requests.post(
'https://hypery.ai/api/v1/chats',
headers={'Authorization': f'Bearer {api_key}'},
json={'title': 'New Conversation'}
)
chat = response.json()['chat']curl -X POST https://hypery.ai/api/v1/chats \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "New Conversation"}'Input Parameters
Get Chat
Get a specific conversation with messages.
Endpoint: GET /api/v1/chats/:id
const response = await fetch(
`https://hypery.ai/api/v1/chats/${chatId}`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
)
const { chat } = await response.json()response = requests.get(
f'https://hypery.ai/api/v1/chats/{chat_id}',
headers={'Authorization': f'Bearer {api_key}'}
)
chat = response.json()['chat']curl https://hypery.ai/api/v1/chats/CHAT_ID \
-H "Authorization: Bearer YOUR_API_KEY"Update Chat
Rename or modify a chat.
Endpoint: PATCH /api/v1/chats/:id
await fetch(`https://hypery.ai/api/v1/chats/${chatId}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Updated Title'
})
})requests.patch(
f'https://hypery.ai/api/v1/chats/{chat_id}',
headers={'Authorization': f'Bearer {api_key}'},
json={'title': 'Updated Title'}
)curl -X PATCH https://hypery.ai/api/v1/chats/CHAT_ID \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Updated Title"}'Delete Chat
Permanently delete a conversation.
Endpoint: DELETE /api/v1/chats/:id
await fetch(`https://hypery.ai/api/v1/chats/${chatId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${apiKey}`
}
})requests.delete(
f'https://hypery.ai/api/v1/chats/{chat_id}',
headers={'Authorization': f'Bearer {api_key}'}
)curl -X DELETE https://hypery.ai/api/v1/chats/CHAT_ID \
-H "Authorization: Bearer YOUR_API_KEY"Get Messages
Get messages for a chat.
Endpoint: GET /api/v1/chats/:id/messages
const response = await fetch(
`https://hypery.ai/api/v1/chats/${chatId}/messages`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
)
const { messages } = await response.json()response = requests.get(
f'https://hypery.ai/api/v1/chats/{chat_id}/messages',
headers={'Authorization': f'Bearer {api_key}'}
)
messages = response.json()['messages']curl https://hypery.ai/api/v1/chats/CHAT_ID/messages \
-H "Authorization: Bearer YOUR_API_KEY"Usage with Chat API
Use the x-chat-id header to associate completions with a chat:
const response = await client.chat.completions.create({
model: 'anthropic/claude-3.5-sonnet',
messages: [...],
}, {
headers: {
'x-chat-id': chatId // Link to existing chat
}
})Messages are automatically saved to the chat history.