API Reference
TrackerAI API
Integrate veterinary AI analysis directly into your applications. Use your API key to authenticate and call the POST /api/v1/analyse endpoint.
Authentication
All API requests must include an X-API-Key header with a valid API key. Generate one from the API Keys page.
http
X-API-Key: trai_sk_YOUR_KEY_HERE
API key usage is counted against your account's daily quota, same as web app usage.
Base URL
text
https://tracker--trackerai-backend-fastapi-app.modal.run/api/v1
Endpoint
POST/api/v1/analyseRun a veterinary analysis
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| model_type | "completion"|"reasoning"|"behavioral" | Yes | Model to use. "completion" and "reasoning" use the same input schema; "behavioral" requires behavioral_subtype. |
| behavioral_subtype | "collar"|"clinical" | No | Required when model_type is "behavioral". Selects wearable-sensor or clinical-history schema. |
| chat_id | integer | No | If provided, appends the message to an existing chat. Must be owned by the authenticated user and have the same model_type. |
| input_data | object | Yes | Model-specific input fields. See schemas below. |
input_data schemas
| Field | Type | Required | Description |
|---|---|---|---|
| species | string | Yes | Animal species, e.g. 'Canine', 'Feline' |
| breed | string | Yes | Breed name, e.g. 'Labrador Retriever' |
| age | string | Yes | Age with units, e.g. '3 years', '6 months' |
| sex | string | Yes | Sex and reproductive status, e.g. 'Male neutered' |
| weight | string | Yes | Body weight with units, e.g. '28 kg' |
| clinical_history | string | Yes | Free-text presenting complaint and relevant history |
Response (200)
| Field | Type | Required | Description |
|---|---|---|---|
| chat_id | integer | Yes | ID of the chat record created or updated |
| message_id | integer | Yes | ID of the assistant message created |
| output.summary | string | Yes | 1-2 sentence clinical summary |
| output.clinical_reasoning | string | null | Yes | Detailed reasoning (reasoning model only) |
| output.differentials | Differential[] | Yes | Up to 5 differential diagnoses |
| output.confidence_level | "low"|"moderate"|"high" | Yes | Model's overall confidence |
| output.emergency_flag | boolean | Yes | True only if objective markers indicate immediate danger |
| output.emergency_justification | string | null | Yes | Required if emergency_flag is true |
| output.recommended_workup | string[] | Yes | Up to 8 recommended diagnostic steps |
| output.initial_management | string[] | Yes | Initial management steps |
| output.prognosis | string | Yes | Prognosis statement |
| output.disclaimer | string | Yes | Standard clinical disclaimer |
| emergency_flag | boolean | Yes | Top-level emergency flag (mirrors output.emergency_flag) |
| confidence_level | string | Yes | Top-level confidence level |
| retry_count | integer | Yes | Number of self-consistency retries used |
Code examples
curl
curl -X POST https://tracker--trackerai-backend-fastapi-app.modal.run/api/v1/analyse \
-H "X-API-Key: trai_sk_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"model_type": "completion",
"input_data": {
"species": "Canine",
"breed": "Labrador Retriever",
"age": "4 years",
"sex": "Male neutered",
"weight": "32 kg",
"clinical_history": "Acute onset vomiting x 3 episodes in 12h. Inappetent. No diarrhoea. Up to date on vaccinations."
}
}'Error codes
401
Unauthorized
Missing or invalid API key / Bearer token.
403
Forbidden
Account is inactive.
422
Unprocessable Entity
Input validation failed. Check the error detail for which field is missing or invalid.
429
Too Many Requests
Daily quota exhausted. Resets at midnight UTC.
500
Internal Server Error
Analysis pipeline failed. Retry once; if persistent, contact support.