Agents

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.

post/agents/{agent_id}/runs

Request

Path parameters

agent_idstring required

Request body multipart/form-data

messagestring required

The input message or prompt to send to the agent

streamboolean

Enable streaming responses via Server-Sent Events (SSE)

session_idstring nullable

Session ID for conversation continuity. If not provided, a new session is created

user_idstring nullable

User identifier for tracking and personalization

filesstring[] nullable

Files to upload (images, audio, video, or documents)

versionstring nullable

Agent version to use for this run

backgroundboolean

Run in background and return immediately with run metadata (requires database)

factory_inputstring nullable

JSON object with factory-specific parameters for dynamic agent construction

Response

Agent run executed successfully

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.