Toggle theme
HTTP API for Agents β
The HTTP API for Agents lets you connect your Tila agent to any external system via HTTP requests. Use it to integrate your agent into apps, chatbots, automations, or backend logic.
Endpoint β
Each agent is available at:
https://tila.ai/channel/api/{channelId}
Where {channelId}
is your agentβs unique identifier.
Parameters β
- input (string) β Your request or instruction for the agent.
- threadId (string, optional) β Dialog/session ID. If omitted, a new conversation starts.
GET Request β
Start a new dialog
bash
curl -X GET "https://tila.ai/channel/api/12345?input=hello"
Continue a dialog
bash
curl -X GET "https://tila.ai/channel/api/12345?threadId=681a191ad74ee8d89080289a"
Example response
json
{
"threadId": "681a191ad74ee8d89080289a",
"content": "Hello! How can I help you today?",
"messages": [
{
"id": "681a191ad74ee8d89080289d",
"content": "Hello! How can I help you today?",
"annotations": []
}
],
"images": []
}
threadId
β Save and reuse for continued dialogs.content
β Agent reply (Markdown by default).messages
β Array with all reply parts.images
β Array of image URLs, if any were generated.
POST Request (JSON) β
Start a new dialog
bash
curl -X POST "https://tila.ai/channel/api/12345" \
-H "Content-Type: application/json" \
-d '{"input":"hello"}'
Continue a dialog
bash
curl -X POST "https://tila.ai/channel/api/12345" \
-H "Content-Type: application/json" \
-d '{"input":"hello","threadId":"681a191ad74ee8d89080289a"}'
Authentication β
If your channel is protected by an API key, add this header:
bash
-H "Authorization: <API_KEY>"
Example:
bash
curl -X POST "https://tila.ai/channel/api/12345" \
-H "Authorization: abcdef123456" \
-H "Content-Type: application/json" \
-d '{"input":"hello"}'
File Upload (multipart/form-data) β
Send files to the agent via the files
field. Multiple files are supported:
bash
curl -X POST "https://tila.ai/channel/api/12345" \
-H "Authorization: abcdef123456" \
-H "Content-Type: multipart/form-data" \
-F "input=how much was spent according to the documents" \
-F "files=@/path/to/file1.pdf" \
-F "files=@/path/to/file2.xlsx"
input
is optional if the agent is configured to process files directly.
Example response with files/images
json
{
"threadId": "681a191ad74ee8d89080289a",
"content": "Here are the documents I found:\n- [file1_link]\n- [file2_link]",
"images": ["image1_link", "image2_link"]
}
content
β Markdown links to generated files.images
β Direct URLs to generated images.
JSON Mode β
If you enable JSON mode in the agent settings, the content
field will return a full JSON object instead of Markdown.