Response format

Turn structure

A task’s turn field is the result from Aist Core. It has three key parts: output (the assistant’s reply), messages (the LLM context) and metadata (cost and model).

For a completed task, GET /api/tasks/{uuid} returns a turn object in the native Aist Core format:

{
  "input":    [/* input items (echoed from the request) */],
  "output":   [/* the assistant's reply — see “Output types” */],
  "messages": [/* raw LLM messages — the actual context */],
  "metadata": {
    "cost": {                              // always zeros — kept for compatibility
      "total": 0,
      "details": { "llm": 0, "tools": 0, "transcription": 0 }
    },
    "model": "claude-sonnet-4-6"       // the model that actually answered
  }
}

Fields

FieldTypeDescription
inputarrayInput items (echoed from the request).
outputarrayThe assistant’s reply, ready to show to the user. See Output types.
messagesarrayThe full LLM history. You need it to continue the conversation. See The messages field.
metadataobjectThe ID of the model that actually answered (model). cost is kept for compatibility and always contains zeros.
Turn cost
Agent doesn’t disclose costs: every money field of a turn — metadata.cost, tool_call.cost, messages[].usage.provider_cost and the like — comes back as zero. The response shape stays the same, so code that reads these fields keeps working.

output vs messages

These are different things. output is the “clean” result for display (text, files and tool calls in the order the assistant performed them). messages is the low-level role/content protocol with call IDs, tool results and thinking blocks; it’s what gets passed back to the model to restore context on the next turn.

metadata.model
If the assistant has a model fallback chain, metadata.model holds the model that actually answered — it may differ from the first one in the chain.