Skip to main content

Execute Agent Stream

POST /api/agents/{id}/execute

Execute a specific chat agent by ID.

Code Examples

curl --request POST \
--url 'https://tess.pareto.io/api/agents/{id}/execute' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"stream": true,
"temperature": "1",
"model": "tess-ai-light",
"messages": [
{ "role": "user", "content": "hello there!" }
],
"tools": "no-tools",
"file_ids": [123, 321]
}'

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe agent ID

Request Body

ParameterTypeRequiredDescription
streambooleanNoStreams the output using the Server-Sent Events format. Default: false
answersobjectYesThe agent answers
messagesarrayOnly for Chat AgentThe agent messages
file_idsarrayNoArray of file IDs to attach to the execution.

Response

data: {"id": 123, "status": "running", "output": "Hi!", "error": null, "credits": null, "root_id": 123, "created_at": "2025-01-01T10:00:00.000000Z", "updated_at": "2025-01-01T10:00:00.000000Z", "template_id": 10}

data: {"id": 123, "status": "completed", "output": "", "error": null, "credits": 10, "root_id": 123, "created_at": "2025-01-01T10:00:00.000000Z", "updated_at": "2025-01-01T10:00:00.000000Z", "template_id": 10}

Try it out!

Authentication

This endpoint requires Bearer token authentication.

Test Endpoint