REST API
Input formats
The input array is what the user sends in the current turn. Each item is one of three types: text, file or voice.
input is required and contains at least one item. You can mix types in a single array — for
example, a text question plus the file it's about.
text
A text prompt — the main format.
{ "type": "text", "text": "Translate the document into English" }
file
A file to analyze. Upload it first via POST /api/files,
then put the returned object into input. The model decides on its own which tool to process it
with (document reading, image recognition and so on).
{
"type": "file",
"file": {
"id": "42", // a string, not a number
"name": "report.pdf",
"mime_type": "application/pdf",
"provider_data": { "path": "…" }
}
}
voice
A voice message. It's transcribed to text before processing. Upload it the same way as a file.
{
"type": "voice",
"voice": {
"id": "7",
"name": "message.ogg",
"mime_type": "audio/ogg",
"duration": 12.5 // seconds, optional
}
}
Example: text + file
"input": [ { "type": "text", "text": "Summarize the document" }, { "type": "file", "file": { "id": "42", "name": "report.pdf", "mime_type": "application/pdf" } } ]
id is always a string
In input[].file.id and input[].voice.id the identifier is passed as a
string, even if POST /api/files returned it as a number. The
id, name and mime_type fields are required.