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-5",
"messages": [
{ "role": "user", "content": "hello there!" }
],
"tools": "no-tools",
"file_ids": [123, 321]
}'

Headers

ParameterTypeRequiredDescription
x-workspace-idintegerNoID of the workspace. If not provided, the user's selected workspace will be used.

Note: This field will be required in a future release of the API. It is highly recommended to set it now to ensure compatibility with future updates.

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