Create a task
POST/api/tasks
Run a new task against an existing worker and wait for the result. Send a taskId of a prior task to add a follow-up turn instead of starting a fresh task. Send multipart/form-data to attach files; the bytes are bootstrapped into the worker’s workspace before the task starts. The task runs to completion on the server even if the connection drops; subscribe to task webhooks for long-running tasks.
Body ParametersJSON
Create a task
curl https://handinger.com/api/tasks \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $HANDINGER_API_KEY" \
-d "{
\"input\": \"What's the weather today in Barcelona?\",
\"budget\": \"standard\",
\"taskId\": \"tsk_2Z-YWz3hFq6VlW\",
\"workerId\": \"wrk_vk81XUHKHG-qr4\"
}"{
"id": "id",
"created_at": 0,
"error": null,
"files": [
{
"filename": "filename",
"mediaType": "mediaType",
"url": "url",
"size": 0
}
],
"incomplete_details": null,
"messages": [
{}
],
"metadata": {
"foo": "bar"
},
"object": "worker",
"output": [
{
"id": "id",
"content": [
{
"text": "text",
"type": "output_text"
}
],
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"output_text": "output_text",
"running": true,
"sources": [
{
"id": "id",
"title": "title",
"type": "url",
"url": "url"
}
],
"status": "running",
"structured_output": {
"foo": "bar"
},
"url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
"usage": {
"credits": 0,
"durationMs": 0
}
}Returns Examples
{
"id": "id",
"created_at": 0,
"error": null,
"files": [
{
"filename": "filename",
"mediaType": "mediaType",
"url": "url",
"size": 0
}
],
"incomplete_details": null,
"messages": [
{}
],
"metadata": {
"foo": "bar"
},
"object": "worker",
"output": [
{
"id": "id",
"content": [
{
"text": "text",
"type": "output_text"
}
],
"role": "assistant",
"status": "completed",
"type": "message"
}
],
"output_text": "output_text",
"running": true,
"sources": [
{
"id": "id",
"title": "title",
"type": "url",
"url": "url"
}
],
"status": "running",
"structured_output": {
"foo": "bar"
},
"url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
"usage": {
"credits": 0,
"durationMs": 0
}
}