Skip to content

AI chat

Walk the same path as the in-app assistant: create a thread (and its first chat), send a question, list the conversation, then manage extra chats and titles.

Published images, videos, and audio are already analysed for you — identifying tags on photos and video, English visual descriptions on images, and English transcriptions on video soundtracks and standalone audio. Chat can search that text; you do not upload the file again on /v0/ai.

Use your API gateway base URL and a session from Authentication. Concepts: AI.

Allow up to five minutes on send. Inference plus tool rounds can take that long.

POST /v0/ai/threads creates the topic and the first empty chat. Capture both ids.

Terminal window
curl -sS "https://<api-gateway-server-url>/v0/ai/threads" \
-H "Authorization: Bearer $SESSION" \
-H "Content-Type: application/json" \
-d '{"title":"My first thread"}'

The response includes thread.id and chat.id. You cannot send a turn without that chat.id.

Terminal window
curl -sS "https://<api-gateway-server-url>/v0/ai/chats/$CHAT_ID/turns" \
-H "Authorization: Bearer $SESSION" \
-H "Content-Type: application/json" \
-d '{"content":"How many spaces am I assigned to?"}'

Try questions that lean on analysed media as well — for example “Which published videos mention the inspection?” or “Show photos tagged as a cracked pipe.”

content is the user message (text is accepted as an alias). The response includes userTurn, assistantTurn, and turns. Assistant refs are entities the model cited (space, channel, asset, and so on) for your UI to link.

Subject to ai.chats.send.perDay. This is not channel /tags.

Terminal window
curl -sS "https://<api-gateway-server-url>/v0/ai/chats/$CHAT_ID/turns" \
-H "Authorization: Bearer $SESSION"

Newest first. offset=0 is the latest page. Default limit is 25 (max 100).

Terminal window
curl -sS "https://<api-gateway-server-url>/v0/ai/threads/$THREAD_ID/chats" \
-H "Authorization: Bearer $SESSION"

A thread can hold multiple conversation chains.

Terminal window
curl -sS "https://<api-gateway-server-url>/v0/ai/threads/$THREAD_ID/chats" \
-H "Authorization: Bearer $SESSION" \
-H "Content-Type: application/json" \
-d '{"title":"Follow-up"}'

Send later turns to the new chat.id if you want a separate chain.

Terminal window
curl -sS -X PATCH "https://<api-gateway-server-url>/v0/ai/threads/$THREAD_ID" \
-H "Authorization: Bearer $SESSION" \
-H "Content-Type: application/json" \
-d '{"title":"Site inspection"}'
curl -sS -X PATCH "https://<api-gateway-server-url>/v0/ai/chats/$CHAT_ID" \
-H "Authorization: Bearer $SESSION" \
-H "Content-Type: application/json" \
-d '{"title":"Counts"}'
Terminal window
curl -sS "https://<api-gateway-server-url>/v0/ai/threads" \
-H "Authorization: Bearer $SESSION"
curl -sS "https://<api-gateway-server-url>/v0/ai/threads/$THREAD_ID" \
-H "Authorization: Bearer $SESSION"

List uses skip pagination (offset, limit). Only the caller’s threads are returned.

Schemas: API reference (tag AI). Limits: Errors & limits.