Skip to content
Get started

Workers

Create a worker
POST/api/workers
Retrieve a worker
GET/api/workers/{workerId}
Continue a worker
POST/api/workers/{workerId}
Stream worker updates
GET/api/workers/{workerId}/stream
Retrieve a worker email address
GET/api/workers/{workerId}/email
Retrieve a worker file
GET/api/workers/{workerId}/files/{filePath}
ModelsExpand Collapse
CreateWorker object { input, budget, stream }
input: string
minLength1
budget: optional "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
stream: optional boolean
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"
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"
One of the following:
"running"
"completed"
"pending"
costs: optional object { internalCostUsd, modelCostUsd, sandboxCostUsd, toolCostUsd }
internalCostUsd: number
minimum0
modelCostUsd: number
minimum0
sandboxCostUsd: number
minimum0
toolCostUsd: number
minimum0
usage: optional object { cacheReadTokens, cacheWriteTokens, costUsd, 6 more }
cacheReadTokens: number
minimum0
cacheWriteTokens: number
minimum0
costUsd: number
minimum0
inputTokens: number
minimum0
outputTokens: number
minimum0
reasoningTokens: number
minimum0
steps: number
minimum0
totalTokens: number
minimum0
credits: optional number
minimum0
WorkerStreamUpdatesResponse = string
WorkerRetrieveEmailResponse = string

WorkersSchedules

Manage future and recurring worker tasks.

List worker schedules
GET/api/workers/{workerId}/schedules
Create a worker schedule
POST/api/workers/{workerId}/schedules
Cancel a worker schedule
DELETE/api/workers/{workerId}/schedules/{scheduleId}
ModelsExpand Collapse
WorkerSchedule = object { id, budget, input, 2 more } or object { id, budget, delayInSeconds, 3 more } or object { id, budget, cron, 3 more } or object { id, budget, input, 3 more }
One of the following:
object { id, budget, input, 2 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
input: string
nextRunAt: string
formatdate-time
type: "scheduled"
object { id, budget, delayInSeconds, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
delayInSeconds: number
input: string
nextRunAt: string
formatdate-time
type: "delayed"
object { id, budget, cron, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
cron: string
input: string
nextRunAt: string
formatdate-time
type: "cron"
object { id, budget, input, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
input: string
intervalSeconds: number
nextRunAt: string
formatdate-time
type: "interval"
ScheduleListResponse object { schedules, workerId }
schedules: array of WorkerSchedule
One of the following:
object { id, budget, input, 2 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
input: string
nextRunAt: string
formatdate-time
type: "scheduled"
object { id, budget, delayInSeconds, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
delayInSeconds: number
input: string
nextRunAt: string
formatdate-time
type: "delayed"
object { id, budget, cron, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
cron: string
input: string
nextRunAt: string
formatdate-time
type: "cron"
object { id, budget, input, 3 more }
id: string
budget: "low" or "standard" or "high" or "unlimited"
One of the following:
"low"
"standard"
"high"
"unlimited"
input: string
intervalSeconds: number
nextRunAt: string
formatdate-time
type: "interval"
workerId: string
ScheduleCancelResponse object { cancelled }
cancelled: boolean