Create Agent Run
Execute an agent with a message and optional media files. Supports both streaming and non-streaming responses.
Features:
- Text message input with optional session management
- Multi-media support: images (PNG, JPEG, WebP), audio (WAV, MP3), video (MP4, WebM, etc.)
- Document processing: PDF, CSV, DOCX, TXT, JSON
- Real-time streaming responses with Server-Sent Events (SSE)
- User and session context preservation
Streaming Response:
When stream=true, returns SSE events with event and data fields.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
The input message or prompt to send to the agent
Enable streaming responses via Server-Sent Events (SSE)
Session ID for conversation continuity. If not provided, a new session is created
User identifier for tracking and personalization
Files to upload (images, audio, video, or documents)
Agent version to use for this run
Run in background and return immediately with run metadata (requires database)
JSON object with factory-specific parameters for dynamic agent construction
Response
Agent run executed successfully
Unique identifier for the run
Parent run ID if this is a nested run
Agent ID that executed this run
User ID associated with the run
Run status (PENDING, RUNNING, COMPLETED, ERROR, etc.)
Input provided to the run
Output content from the run
Format of the response (text/json)
Reasoning content if reasoning was enabled
List of reasoning steps
Performance and usage metrics
Message history for the run
Tools used in the run
Events generated during the run
Run creation timestamp
References cited in the run
Citations from the model (e.g., from Gemini grounding/search)
Reasoning process messages
Session state at the end of the run
Images included in the run
Videos included in the run
Audio files included in the run
Files included in the run
Audio response if generated
Input media attachments
Followup suggestions generated after the run
If this run was forked from another run, the source run's ID
If this run was forked, the message index at which the source was truncated
If this run was created via session branch, the source session's ID
If this run was produced via regenerate=true, the source run's ID
Message index of the most recent mid-run checkpoint (checkpoint='tool-batch' runs)