Skip to Content
API ReferenceMessage Part Types

Message Part Types

Messages use a parts array to represent content. The part types differ between request (what you send) and response (what the API returns). Both follow the AI SDK UIMessage  format.

Request Parts

These are the part types you can include in the parts array when sending a message via POST /api/chat:

Part TypeFieldsDescription
texttextUser’s text message
filemediaType, url, filename?File attachment — url must be a data URL

At minimum, include one text part. Example:

{ "parts": [ { "type": "text", "text": "What's in this image?" }, { "type": "file", "mediaType": "image/png", "url": "data:image/png;base64,..." } ] }

Response Parts

These are the part types the Pandora API can emit in assistant messages, both during streaming and in stored thread history:

Part TypeFieldsWhen Emitted
texttext, state? ('streaming' | 'done')Always — LLM text output
tool-{name}toolCallId, state, input, output, errorTextWhen the agent calls a tool
reasoningtext, state?, providerMetadata?When the model supports reasoning/thinking
source-urlsourceId, url, title?, providerMetadata?When the model provides citations
filemediaType, url, filename?When the response includes files
step-startAt the start of each agent step

Tool parts have dynamic type names like tool-current-time or tool-web-search. Check for the tool- prefix when rendering.

Tool Part States

Tool parts go through a lifecycle indicated by the state field:

StateMeaning
partial-callTool is being called — input is still streaming in
callTool call is complete — input is final, waiting for result
approval-requestedTool requires user approval before executing. The part includes an approval object with { id: string } containing the run ID. Use POST /api/chat/approve to approve or deny.
input-availableTool input is ready (intermediate state before execution)
output-availableTool finished — output contains the result
errorTool failed — errorText contains the error message
Last updated on