Skip to content
Get started

Workers

Create a worker
workers.create(WorkerCreateParams**kwargs) -> Worker
POST/api/workers
Retrieve a worker
workers.retrieve(strworker_id, WorkerRetrieveParams**kwargs) -> Worker
GET/api/workers/{workerId}
Continue a worker
workers.continue_(strworker_id, WorkerContinueParams**kwargs) -> Worker
POST/api/workers/{workerId}
Stream worker updates
workers.stream_updates(strworker_id) -> WorkerStreamUpdatesResponse
GET/api/workers/{workerId}/stream
Retrieve a worker email address
workers.retrieve_email(strworker_id) -> WorkerRetrieveEmailResponse
GET/api/workers/{workerId}/email
Retrieve a worker file
workers.retrieve_file(strfile_path, WorkerRetrieveFileParams**kwargs) -> BinaryResponseContent
GET/api/workers/{workerId}/files/{filePath}
ModelsExpand Collapse
class CreateWorker:
input: str
minLength1
budget: Optional[Literal["low", "standard", "high", "unlimited"]]
One of the following:
"low"
"standard"
"high"
"unlimited"
stream: Optional[bool]
class Worker:
id: str
created_at: Optional[int]
error: None
files: List[File]
filename: Optional[str]
media_type: str
url: str
incomplete_details: None
messages: List[object]
metadata: Dict[str, object]
object: Literal["worker"]
output: List[Output]
id: str
content: List[OutputContent]
text: str
type: Literal["output_text"]
role: Literal["assistant"]
status: Literal["completed"]
type: Literal["message"]
output_text: str
running: bool
sources: List[Source]
id: str
title: Optional[str]
type: Literal["url"]
url: str
status: Literal["running", "completed", "pending"]
One of the following:
"running"
"completed"
"pending"
costs: Optional[Costs]
internal_cost_usd: float
minimum0
model_cost_usd: float
minimum0
sandbox_cost_usd: float
minimum0
tool_cost_usd: float
minimum0
usage: Optional[Usage]
cache_read_tokens: int
minimum0
cache_write_tokens: int
minimum0
cost_usd: float
minimum0
input_tokens: int
minimum0
output_tokens: int
minimum0
reasoning_tokens: int
minimum0
steps: int
minimum0
total_tokens: int
minimum0
credits: Optional[int]
minimum0
str
str

WorkersSchedules

Manage future and recurring worker tasks.

List worker schedules
workers.schedules.list(strworker_id) -> ScheduleListResponse
GET/api/workers/{workerId}/schedules
Create a worker schedule
workers.schedules.create(strworker_id, ScheduleCreateParams**kwargs) -> WorkerSchedule
POST/api/workers/{workerId}/schedules
Cancel a worker schedule
workers.schedules.cancel(strschedule_id, ScheduleCancelParams**kwargs) -> ScheduleCancelResponse
DELETE/api/workers/{workerId}/schedules/{scheduleId}
ModelsExpand Collapse
One of the following:
class UnionMember0:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
input: str
next_run_at: datetime
formatdate-time
type: Literal["scheduled"]
class UnionMember1:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
delay_in_seconds: int
input: str
next_run_at: datetime
formatdate-time
type: Literal["delayed"]
class UnionMember2:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
cron: str
input: str
next_run_at: datetime
formatdate-time
type: Literal["cron"]
class UnionMember3:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
input: str
interval_seconds: int
next_run_at: datetime
formatdate-time
type: Literal["interval"]
class ScheduleListResponse:
schedules: List[WorkerSchedule]
One of the following:
class UnionMember0:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
input: str
next_run_at: datetime
formatdate-time
type: Literal["scheduled"]
class UnionMember1:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
delay_in_seconds: int
input: str
next_run_at: datetime
formatdate-time
type: Literal["delayed"]
class UnionMember2:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
cron: str
input: str
next_run_at: datetime
formatdate-time
type: Literal["cron"]
class UnionMember3:
id: str
budget: Literal["low", "standard", "high", "unlimited"]
One of the following:
"low"
"standard"
"high"
"unlimited"
input: str
interval_seconds: int
next_run_at: datetime
formatdate-time
type: Literal["interval"]
worker_id: str
class ScheduleCancelResponse:
cancelled: bool