Using the API directly is not recommended for most users. Instead, we recommend using the Python SDK.
Retrieving and Managing Job State
Job Status
Retrieve the status of a priority 1 job by its job_id. param str job_id
The job_id returned when you submitted the job. reqheader Authorization
Your Sutro API key. Accept
application/json >json message
Message describing the job’s current status. >json job_status
The current status of the job. >json metadata
If the status isfailed
during job initialization, will contain a keyfailure_reason
. This will contain a keymessage
with a verbose message for the failure, and optionally a keyadditional_context
with additional info to help debug the failure. The job_status will be one of the following:
succeeded
: The job completed successfully.failed
: The job failed.cancelled
: The job was cancelled.pending
: The job is still pending.submitted
: The job has been submitted.starting
: The job is starting.running
: The job is running.unknown
: The job status is unknown.
Cancelling a Job
Cancel a priority 1 job by its job_id. param str job_id
The job_id returned when you submitted the job. reqheader Authorization
Your Sutro API key. Accept
application/json >json cancelled
True if the job was cancelled, False otherwise. >json message
Verbose message for the job’s cancellation status.
Retrieving Results
Retrieve the results of a priority 1 job by its job_id. param str job_id
The job_id returned when you submitted the job. param bool include_inputs
Whether to include the inputs in the results. param bool include_cumulative_logprobs
Whether to include the cumulative logprobs in the results. reqheader Authorization
Your Sutro API key. Accept
application/json >json results
Ifinclude_inputs
isTrue
, the results will be a dictionary withinputs
andoutputs
keys. Ifinclude_inputs
isFalse
, the results will be a list of outputs, in the same order as the inputs. >json message
Verbose message for the job’s results.
Listing All Jobs
List all current and historical jobs, and associated metadata. reqheader Authorization
Your Sutro API key. Accept
application/json >json jobs
A list of jobs you have access to. >json message
Verbose message for the job’s results.