Skip to content
Get started

Create a task

$ handinger tasks create
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.

ParametersExpand Collapse
--input: string
--budget: optional "low" or "standard" or "high" or "unlimited"

Compute budget the worker is allowed to spend on the task. Defaults to standard.

--task-id: optional string

Optional client-provided task id. Reuse this id to add turns to an existing task.

--worker-id: optional string

Worker id the task belongs to. If omitted, a new worker is created on-the-fly using the input as instructions.

ReturnsExpand Collapse
worker: object { id, created_at, error, 13 more }
id: string
created_at: number
error: unknown
files: array of object { filename, mediaType, url, size }
filename: string
mediaType: string
url: string
size: optional number
incomplete_details: unknown
messages: array of unknown
metadata: map[unknown]
object: "worker"
output: array of object { id, content, role, 2 more }
id: string
content: array of object { text, type }
text: string
type: "output_text"
role: "assistant"
status: "completed"
type: "message"
output_text: string
running: boolean
sources: array of object { id, title, type, url }
id: string
title: string
type: "url"
url: string
status: "running" or "completed" or "pending"
"running"
"completed"
"pending"
structured_output: map[unknown]
url: string

Web URL of the worker in the Handinger dashboard.

usage: optional object { durationMs }
durationMs: optional number

Create a task

handinger tasks create \
  --api-key 'My API Key' \
  --input "What's the weather today in Barcelona?"
{
  "id": "id",
  "created_at": 0,
  "error": null,
  "files": [
    {
      "filename": "filename",
      "mediaType": "mediaType",
      "url": "https://example.com",
      "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": {
    "durationMs": 0
  }
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "error": null,
  "files": [
    {
      "filename": "filename",
      "mediaType": "mediaType",
      "url": "https://example.com",
      "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": {
    "durationMs": 0
  }
}