## Create a worker `$ handinger workers create` **post** `/api/workers` Create a new agent worker and start it with the supplied instruction. ### Parameters - `--input: string` - `--budget: optional "low" or "standard" or "high" or "unlimited"` - `--stream: optional boolean` ### Returns - `worker: object { id, created_at, error, 12 more }` - `id: string` - `created_at: number` - `error: unknown` - `files: array of object { filename, mediaType, url }` - `filename: string` - `mediaType: string` - `url: string` - `incomplete_details: unknown` - `messages: array of unknown` - `metadata: map[unknown]` - `object: "worker"` - `"worker"` - `output: array of object { id, content, role, 2 more }` - `id: string` - `content: array of object { text, type }` - `text: string` - `type: "output_text"` - `"output_text"` - `role: "assistant"` - `"assistant"` - `status: "completed"` - `"completed"` - `type: "message"` - `"message"` - `output_text: string` - `running: boolean` - `sources: array of object { id, title, type, url }` - `id: string` - `title: string` - `type: "url"` - `"url"` - `url: string` - `status: "running" or "completed" or "pending"` - `"running"` - `"completed"` - `"pending"` - `costs: optional object { internalCostUsd, modelCostUsd, sandboxCostUsd, toolCostUsd }` - `internalCostUsd: number` - `modelCostUsd: number` - `sandboxCostUsd: number` - `toolCostUsd: number` - `usage: optional object { cacheReadTokens, cacheWriteTokens, costUsd, 6 more }` - `cacheReadTokens: number` - `cacheWriteTokens: number` - `costUsd: number` - `inputTokens: number` - `outputTokens: number` - `reasoningTokens: number` - `steps: number` - `totalTokens: number` - `credits: optional number` ### Example ```cli handinger workers create \ --api-key 'My API Key' \ --input x ``` #### Response ```json { "id": "id", "created_at": 0, "error": null, "files": [ { "filename": "filename", "mediaType": "mediaType", "url": "url" } ], "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", "costs": { "internalCostUsd": 0, "modelCostUsd": 0, "sandboxCostUsd": 0, "toolCostUsd": 0 }, "usage": { "cacheReadTokens": 0, "cacheWriteTokens": 0, "costUsd": 0, "inputTokens": 0, "outputTokens": 0, "reasoningTokens": 0, "steps": 0, "totalTokens": 0, "credits": 0 } } ```