Using the API directly is not recommended for most users. Instead, we recommend using the
Python SDK .
Retrieve the status of a batch inference job by its job_id.
Request Parameters
The job_id returned when you submitted the batch inference job
Your Sutro API key using Key authentication scheme. Format: Key YOUR_API_KEY Example: Authorization: Key sk_live_abc123...
Response
Returns the current status and details of the batch inference job.
Message describing the job’s current status
The current status of the job. See status values below
Additional information about the job. If the status is failed during job initialization, will contain a failure_reason key with details about the failure, and optionally an additional_context key with debugging information
Job Status Values
The job_status field 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
Successful Job
Running Job
Failed Job
{
"message" : "Job completed successfully" ,
"job_status" : "succeeded" ,
"metadata" : {}
}
Code Examples
import requests
job_id = "batch_job_12345"
response = requests.get(
f 'https://api.sutro.sh/job-status/ { job_id } ' ,
headers = {
'Authorization' : 'Key YOUR_SUTRO_API_KEY'
}
)
result = response.json()
print ( f "Job Status: { result[ 'job_status' ] } " )
print ( f "Message: { result[ 'message' ] } " )
if result[ 'job_status' ] == 'failed' :
print ( f "Failure Reason: { result[ 'metadata' ].get( 'failure_reason' , 'Unknown' ) } " )