Create a new thread for an agent
Creates a new execution thread for the specified agent. Threads allow you to run agent tasks, manage their state, and track associated costs.
Authorizations
Use JWT token for authentication
Path Parameters
UUID of the agent for which to create the thread
Body
Payload to create a new thread
Initial messages for the thread
Custom metadata to associate with the thread
Tenant (customer/organization) this thread belongs to in multi-tenant setups. Auto-registers the tenant on first use and attributes its cost/usage. See the Tenants endpoints.
End user/entity inside the tenant. When omitted it is derived from metadata.subtenantMetadata.id or the legacy metadata.userId. Used for per-subtenant cost attribution and usage limits.
Whether to execute the thread asynchronously
Response
Thread created successfully
Unique identifier for the thread
Unique identifier for the associated agent
Current status of the thread
RUNNING, PAUSED, COMPLETED, FAILED, AWAITING_APPROVAL Timestamp when the thread was created
Messages exchanged in the thread
Timestamp when the thread was last updated
Custom metadata associated with the thread
Total cost accumulated by this thread