Retrieving and Managing Job State

Retrieving and Managing Job State#

Job Status#

GET https://api.sutro.sh/job-status/{job_id}#

Retrieve the status of a priority 1 job by its job_id.

Parameters:
  • job_id (str) – The job_id returned when you submitted the job.

Request Headers:
Accept:

application/json

Response JSON Object:
  • message – Message describing the job’s current status.

  • job_status – The current status of the job.

  • metadata – If the status is failed during job initialization, will contain a key failure_reason. This will contain a key message with a verbose message for the failure, and optionally a key additional_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#

POST https://api.sutro.sh/job-cancel/{job_id}#

Cancel a priority 1 job by its job_id.

Parameters:
  • job_id (str) – The job_id returned when you submitted the job.

Request Headers:
Accept:

application/json

Response JSON Object:
  • cancelled – True if the job was cancelled, False otherwise.

  • message – Verbose message for the job’s cancellation status.

Retrieving Results#

POST https://api.sutro.sh/job-results/#

Retrieve the results of a priority 1 job by its job_id.

Parameters:
  • job_id (str) – The job_id returned when you submitted the job.

  • include_inputs (bool) – Whether to include the inputs in the results.

  • include_cumulative_logprobs (bool) – Whether to include the cumulative logprobs in the results.

Request Headers:
Accept:

application/json

Response JSON Object:
  • results – If include_inputs is True, the results will be a dictionary with inputs and outputs keys. If include_inputs is False, the results will be a list of outputs, in the same order as the inputs.

  • message – Verbose message for the job’s results.

Listing All Jobs#

GET https://api.sutro.sh/list-jobs/#

List all current and historical jobs, and associated metadata.

Request Headers:
Accept:

application/json

Response JSON Object:
  • jobs – A list of jobs you have access to.

  • message – Verbose message for the job’s results.