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

FieldTypeRequiredDescription
model_type"completion"|"reasoning"|"behavioral"YesModel to use. "completion" and "reasoning" use the same input schema; "behavioral" requires behavioral_subtype.
behavioral_subtype"collar"|"clinical"NoRequired when model_type is "behavioral". Selects wearable-sensor or clinical-history schema.
chat_idintegerNoIf provided, appends the message to an existing chat. Must be owned by the authenticated user and have the same model_type.
input_dataobjectYesModel-specific input fields. See schemas below.

input_data schemas

FieldTypeRequiredDescription
speciesstringYesAnimal species, e.g. 'Canine', 'Feline'
breedstringYesBreed name, e.g. 'Labrador Retriever'
agestringYesAge with units, e.g. '3 years', '6 months'
sexstringYesSex and reproductive status, e.g. 'Male neutered'
weightstringYesBody weight with units, e.g. '28 kg'
clinical_historystringYesFree-text presenting complaint and relevant history

Response (200)

FieldTypeRequiredDescription
chat_idintegerYesID of the chat record created or updated
message_idintegerYesID of the assistant message created
output.summarystringYes1-2 sentence clinical summary
output.clinical_reasoningstring | nullYesDetailed reasoning (reasoning model only)
output.differentialsDifferential[]YesUp to 5 differential diagnoses
output.confidence_level"low"|"moderate"|"high"YesModel's overall confidence
output.emergency_flagbooleanYesTrue only if objective markers indicate immediate danger
output.emergency_justificationstring | nullYesRequired if emergency_flag is true
output.recommended_workupstring[]YesUp to 8 recommended diagnostic steps
output.initial_managementstring[]YesInitial management steps
output.prognosisstringYesPrognosis statement
output.disclaimerstringYesStandard clinical disclaimer
emergency_flagbooleanYesTop-level emergency flag (mirrors output.emergency_flag)
confidence_levelstringYesTop-level confidence level
retry_countintegerYesNumber 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.