POST /agents/{id}/execute
Execute a specific chat agent by ID.
Code Examples
curl --request POST \
--url 'https://api.tess.im/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]
}'
| Parameter | Type | Required | Description |
|---|
| x-workspace-id | integer | No | ID 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
| Parameter | Type | Required | Description |
|---|
| id | integer | Yes | The agent ID |
Request Body
| Parameter | Type | Required | Description |
|---|
| stream | boolean | No | Streams the output using the Server-Sent Events format. Default: false |
| answers | object | Yes | The agent answers |
| messages | array | Only for Chat Agent | The agent messages |
| file_ids | array | No | Array 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}