Follow a turn
Reads a turn create_with_awen started: its status, its reply's text, its tasks and the files it saved. status is working, completed, failed or stopped. The reply ends when generations start, and the turn stays working until their tasks end. completed means every file it will make is saved; a task that failed says why in failure, so tell the user and never retry on your own. text is written as generations start and never changes: it can still say an image is generating, and it is null when the reply has no words, so read status and files to know what is ready, and fetch a file for the prompt awen used. tasks and files list at most 50 tasks: more_tasks is true when the turn made more, and list_files shows them all. The call waits up to wait_seconds (0 to 30, default 15) and answers as soon as something changes, so call it again at once while status is working, with no other pause. A turn can end with a question, with or without files: show it to the user and wait, and never answer it yourself. cost_usd is what the turn's model calls and generations were charged. It is null until nothing of the turn still runs, and where usage is hidden from members; titles, summaries and file descriptions are charged apart. Pass the last cursor back, so a change between two calls is not missed. files name each file by id with its mime_type, size_bytes, width, height and duration_seconds, each null when unknown. With include_downloads, each file also has a download_url valid 5 minutes, or null when it cannot be downloaded; without it, pass an id to fetch for one. To follow several turns at once, call get_turns.
Needs a key with awen:read. Costs 1 to 4 units of the key's rate limit, by its arguments.
apiKeyAuthorizationBearer <token>An API key from Settings → Connected apps → API keys, sent as Authorization: Bearer awen_sk_…. Keep it on a server: a request from a web page is refused.
application/json- body
turn_id*stringThe turn_id create_with_awen returned, a conversation's active_turn_id, or an answer's turn_id from fetch on a conversation.
^[A-Za-z0-9_-]+$1 <= length <= 128cursor?stringThe cursor of the last answer. Without it, the wait starts from the turn as it is now.
1 <= length <= 512wait_seconds?integerHow long to wait for a change. 0 answers at once.
0 <= value <= 30include_downloads?booleanAdds a download_url, valid 5 minutes, to each file. Ask for it once the files you need are listed.
The operation's answer.
application/json- response
turn_id*stringconversation_id*stringproject_id*stringstatus*string"working""completed""failed""stopped"cursor*stringtext*string|nulltasks*array<>files*array<>more_tasks*booleanfailure*string|nullcost_usd*number|nullurl*stringcurl -X POST 'https://app.awen.ai/api/v1/get_turn' \ -H 'Content-Type: application/json' \ -d '{ "turn_id": "string"}'{ "turn_id": "string", "conversation_id": "string", "project_id": "string", "status": "working", "cursor": "string", "text": "string", "tasks": [ { "id": "string", "tool": "string", "status": "running", "failure": "string" } ], "files": [ { "id": "string", "entry_id": "string", "media_id": "string", "revision_id": "string", "kind": "folder", "name": "string", "url": "string", "mime_type": "string", "size_bytes": 0, "width": 1, "height": 1, "duration_seconds": 1, "download_url": "string" } ], "more_tasks": true, "failure": "string", "cost_usd": 0, "url": "string"}Read a file's lineage POST
Reads how a file was made, whatever its kind (image, video, 3D model, canvas, whiteboard or document), as awen's Lineage panel shows it: the files it came from, the step that used each one, each file's "Authorized for usage" declaration and audit severity, and the latest lineage audit. The declaration is false until a member confirms a file's rights in awen, which does not mean it is forbidden. unaudited counts the earlier files no audit has read, not this file, and the audit is null until one runs. Pass a file:… id or a media_id. Files come nearest first, up to 50 a page, with the edges from each file to the files made from it; pass next_cursor back as cursor to continue. fetch opens a file whose id is not null and gives its prompt and model. complete is false when the history is too long to read here: audit counts are then left out, and awen shows it whole. Needs a key with awen:read. Costs 4 units of the key's rate limit.
Follow several turns POST
Follows up to 10 turns create_with_awen started, in one call. Each turn reads as get_turn reads it: status, task_counts, files, more_tasks, failure, cost_usd and its reply's text, with the same meanings. The call waits up to wait_seconds (0 to 30, default 15) and answers as soon as any turn changes, or at once when none can change any more, so call it again at once while a turn is working, with no other pause. Pass the last cursor back with the same turn_ids, so a change between two calls is not missed: a turn's text is then left out when it has not changed since that answer. A turn that is not found answers error and no other field. Call get_turn for a turn's tasks and why each failed, and with include_downloads for its files' download links. Needs a key with awen:read. Costs 2 units of the key's rate limit.