Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Runs

List Runs
runs.list(RunListParams**kwargs) -> SyncArrayPage[Run]
get/v1/runs/
Retrieve Run
runs.retrieve(strrun_id) -> Run
get/v1/runs/{run_id}
ModelsExpand Collapse
class Job:

Representation of offline jobs, used for tracking status of data loading tasks (involving parsing and embedding files).

id: Optional[str]

The human-friendly ID of the Job

agent_id: Optional[str]

The agent associated with this job/run.

background: Optional[bool]

Whether the job was created in background mode.

callback_error: Optional[str]

Optional error message from attempting to POST the callback endpoint.

callback_sent_at: Optional[datetime]

Timestamp when the callback was last attempted.

formatdate-time
callback_status_code: Optional[int]

HTTP status code returned by the callback endpoint.

callback_url: Optional[str]

If set, POST to this URL when the job completes.

completed_at: Optional[datetime]

The unix timestamp of when the job was completed.

formatdate-time
created_at: Optional[datetime]

The unix timestamp of when the job was created.

formatdate-time
created_by_id: Optional[str]

The id of the user that made this object.

job_type: Optional[JobType]

The type of the job.

Accepts one of the following:
"job"
"run"
"batch"
last_updated_by_id: Optional[str]

The id of the user that made this object.

metadata: Optional[Dict[str, object]]

The metadata of the job.

status: Optional[JobStatus]

The status of the job.

Accepts one of the following:
"created"
"running"
"completed"
"failed"
"pending"
"cancelled"
"expired"
stop_reason: Optional[StopReasonType]

The reason why the job was stopped.

Accepts one of the following:
"end_turn"
"error"
"llm_api_error"
"invalid_llm_response"
"invalid_tool_call"
"max_steps"
"no_tool_call"
"tool_rule"
"cancelled"
"requires_approval"
total_duration_ns: Optional[int]

Total run duration in nanoseconds

ttft_ns: Optional[int]

Time to first token for a run in nanoseconds

updated_at: Optional[datetime]

The timestamp when the object was last updated.

formatdate-time
StopReasonType = Literal["end_turn", "error", "llm_api_error", 7 more]
Accepts one of the following:
"end_turn"
"error"
"llm_api_error"
"invalid_llm_response"
"invalid_tool_call"
"max_steps"
"no_tool_call"
"tool_rule"
"cancelled"
"requires_approval"

RunsMessages

List Run Messages
runs.messages.list(strrun_id, MessageListParams**kwargs) -> SyncArrayPage[LettaMessageUnion]
get/v1/runs/{run_id}/messages
Retrieve Stream
runs.messages.stream(strrun_id, MessageStreamParams**kwargs) -> object
post/v1/runs/{run_id}/stream

RunsUsage

Retrieve Run Usage
runs.usage.retrieve(strrun_id) -> UsageRetrieveResponse
get/v1/runs/{run_id}/usage

RunsSteps

List Run Steps
runs.steps.list(strrun_id, StepListParams**kwargs) -> SyncArrayPage[Step]
get/v1/runs/{run_id}/steps