Content Parts

Content Parts

Message content is an array of content parts. Each part has a type and type-specific fields.

Content Part Types

TypeDescriptionRequired Fields
textPlain texttext
reasoningChain-of-thoughttext
jsonStructured datadata
imageImage referenceref
audioAudio referenceref
videoVideo referenceref
documentDocument referenceref
tool_callTool invocationname, call_id, arguments
tool_resultTool outputname, call_id, result

Text

Plain text content:

{ "type": "text", "text": "Hello, world!" }

Reasoning

Chain-of-thought or scratchpad content. Use reasoning_policy in defaults to control training behavior:

{
  "type": "reasoning",
  "text": "Let me think through this step by step. First, I need to..."
}

JSON

Structured data output:

{
  "type": "json",
  "data": {
    "name": "John",
    "age": 30,
    "city": "New York"
  }
}

Media Types

Images, audio, video, and documents reference external files:

{
  "type": "image",
  "ref": { "asset_id": "img-001" },
  "mime_type": "image/jpeg"
}

Or with direct URI:

{
  "type": "audio",
  "ref": { "uri": "s3://bucket/audio/clip.wav" },
  "mime_type": "audio/wav",
  "sha256": "abc123...",
  "bytes": 123456
}

Reference Options

FieldDescription
ref.asset_idReference to assets.jsonl entry (preferred)
ref.uriDirect URI to the file
mime_typeMIME type of the content
sha256SHA-256 hash for verification
bytesFile size in bytes

Tool Call

Invoke a tool:

{
  "type": "tool_call",
  "name": "calculator",
  "call_id": "calc-001",
  "arguments": { "expression": "2 + 2" }
}
FieldRequiredDescription
nameYesTool name (must match toolset)
call_idYesUnique identifier for this call
argumentsYesTool input arguments

Tool Result

Return from a tool execution:

{
  "type": "tool_result",
  "name": "calculator",
  "call_id": "calc-001",
  "result": { "value": 4 }
}
FieldRequiredDescription
nameYesTool name
call_idYesMatches the tool_call
resultYesTool output

Mixed Content

Messages can contain multiple content parts:

{
  "role": "user",
  "content": [
    { "type": "text", "text": "Describe this image:" },
    { "type": "image", "ref": { "asset_id": "img-001" } }
  ]
}
{
  "role": "assistant",
  "content": [
    { "type": "reasoning", "text": "I should analyze the visual elements..." },
    { "type": "text", "text": "The image shows a sunset over the ocean." }
  ]
}

Metadata

Any content part can include metadata:

{
  "type": "text",
  "text": "Hello!",
  "metadata": {
    "source": "human",
    "confidence": 0.95
  }
}