Send a message to VetsGPT
Sends one message to VetsGPT, waits for the complete answer and returns both stored messages as JSON (no streaming). It runs the same engine as the web app: the message is classified as clinical or administrative, clinical questions are answered from web and clinic-knowledge search with inline citations, and the chat's consultation, patient and file context is included. An answer involves several model calls and searches, so expect responses to take a while and use a long client timeout.
Omit chatId to start a chat (its id is derived from idempotencyKey), or pass an existing chat's id to continue it. The caller must own the chat or have contribute access. Only the owner can send consultationIds or patientId to update its context before a new question; contributors must omit both.
Idempotency: every request needs an idempotencyKey. Repeating a request with the same key returns the stored answer without generating again. With server-coordinated turns, changing the prompt, files or generation options under the same key is a conflict. If an earlier request with that key is still generating, the call waits for it, and returns 409 CONFLICT if it does not finish. If generation fails, the question stays stored and requires an explicit retry: true action by the original sender to restart the latest interrupted request before later messages. The question retains its original linked context. Ordinary network replay never restarts it. 409 CHAT_BUSY means another question is generating; REQUEST_MISMATCH means the payload changed under the same key; RETRY_NOT_ALLOWED means an explicit retry can no longer restart.
Deep Research, streaming, and the consultation editor actions of the web app are not available through this endpoint. The first VetsGPT use in a workspace without a subscription can start its free trial. Errors: 403 when VetsGPT is disabled for the caller, 404 for an unknown chat, insufficient chat permission or an unreadable consultation, 500 when generation fails.
Request
- Base URLhttps://vetnio.com/api/v2
- URLhttps://vetnio.com/api/v2/workspaces/{workspaceId}/vetsgpt/ask
- AuthHTTP bearer
Path parameters
Identifier of the workspace (clinic). The caller must be a member, and VetsGPT must be enabled for them in this workspace.
Request body
Example request
{
"chatId": "3f9c2a71-5b8e-4d1a-9c47-0e6b2d8f1a53",
"title": "NSAID dosing in a dog with CKD",
"message": "What is the meloxicam dose for a 24 kg dog with stage 2 CKD?",
"idempotencyKey": "0b7f6a52-93c1-4e2d-8a4f-61d0c9e3b7aa",
"consultationIds": [
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
],
"patientId": "f2a3b4c5-d6e7-4890-fabc-012345678901",
"imageKeys": [
"chats/furunculotic-loud-chihuahua/3f9c2a71-5b8e-4d1a-9c47-0e6b2d8f1a53/attachments/6a1e0f3c-2b9d-4c7e-8f5a-1d3b9e7c2a40"
],
"pdfKeys": [
"chats/furunculotic-loud-chihuahua/3f9c2a71-5b8e-4d1a-9c47-0e6b2d8f1a53/attachments/9c2b7e14-5f3a-4d8b-a1e6-0f7c3d9b2e58"
],
"categoryHint": "clinical"
}Response
The persisted user message and completed VetsGPT answer.
Example response
{
"chat": {
"chatId": "rest-chat-4b1f0c9e2d7a4e6b8c3f5a1d9e0b2c7f",
"title": "NSAID dosing in a dog with CKD",
"createdAt": "2026-10-04T09:12:31.000Z",
"updatedAt": "2026-10-04T09:12:58.000Z"
},
"userMessage": {
"messageId": "rest-assistant-message-9d2e7c1b4a6f8e0d3c5b7a9f1e2d4c6b",
"timestamp": "2026-10-04T09:12:58.000Z",
"role": "assistant",
"content": "Meloxicam is generally avoided in dogs with CKD unless the benefit outweighs the risk...",
"attachments": [
"chats/furunculotic-loud-chihuahua/3f9c2a71-5b8e-4d1a-9c47-0e6b2d8f1a53/attachments/6a1e0f3c-2b9d-4c7e-8f5a-1d3b9e7c2a40"
],
"feedback": "none"
},
"assistantMessage": {
"messageId": "rest-assistant-message-9d2e7c1b4a6f8e0d3c5b7a9f1e2d4c6b",
"timestamp": "2026-10-04T09:12:58.000Z",
"role": "assistant",
"content": "Meloxicam is generally avoided in dogs with CKD unless the benefit outweighs the risk...",
"attachments": [
"chats/furunculotic-loud-chihuahua/3f9c2a71-5b8e-4d1a-9c47-0e6b2d8f1a53/attachments/6a1e0f3c-2b9d-4c7e-8f5a-1d3b9e7c2a40"
],
"feedback": "none"
},
"progressEvents": [
"analyzing_question",
"searching_sources",
"generating_answer"
]
}Changes
No recorded changes to this operation across all 1 revision of this API.