API
Analysing a broadcast from your own code
Upload the file to the bucket, call one endpoint with the path, and KAIROS runs the same analysis the app runs. Your workspace, your plan, your allowance — an API key does nothing a signed-in person could not do.
The whole thing, end to end
Five calls. Uploading and analysing are separate on purpose: you can push a batch of files overnight and decide later which of them to analyse.
# 1. Ask for somewhere to put the file.
curl -sX POST https://kairosapp.tech/api/uploads \
-H "Authorization: Bearer $KAIROS_KEY" \
-H 'content-type: application/json' \
-d '{"filename":"match.mp4","sizeBytes":734003200}'
# -> {"path":"tenants/…/inbox/Ab3…/match.mp4","sessionUri":"https://storage.googleapis.com/…"}
# 2. Send the bytes. One PUT if it is small; see "Sending the bytes" for chunks.
curl -sX PUT "$SESSION_URI" --upload-file match.mp4
# 3. Start the analysis, naming the path from step 1.
curl -sX POST https://kairosapp.tech/api/analyses \
-H "Authorization: Bearer $KAIROS_KEY" \
-H 'content-type: application/json' \
-d '{"path":"tenants/…/inbox/Ab3…/match.mp4","title":"France v Spain","domain":"sport"}'
# -> {"assetId":"e5f1…","status":"uploaded"}
# 4. Wait for it.
curl -s https://kairosapp.tech/api/assets/e5f1…/progress -H "Authorization: Bearer $KAIROS_KEY"
# -> {"phase":"analysing","heartbeatAgeSeconds":4,…} then eventually {"phase":"done",…}
# 5. Read it.
curl -s https://kairosapp.tech/api/assets/e5f1…/timeline -H "Authorization: Bearer $KAIROS_KEY"Something here wrong or missing? Tell us — it is the kind of bug nobody reports.Back to KAIROS