Documentation Index
Fetch the complete documentation index at: https://docs.sutro.sh/llms.txt
Use this file to discover all available pages before exploring further.
Using the API directly is not recommended for most users. Instead, we recommend using the
Python SDK.
Cancel 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_KEYExample: Authorization: Key sk_live_abc123...
Response
Returns the cancellation status of the job.
True if the job was cancelled, False otherwise
Verbose message describing the job’s cancellation status
{
"cancelled": true,
"message": "Job batch_job_12345 has been successfully cancelled"
}
Code Examples
import requests
job_id = "batch_job_12345"
response = requests.post(
f'https://api.sutro.sh/job-cancel/{job_id}',
headers={
'Authorization': 'Key YOUR_SUTRO_API_KEY',
'Content-Type': 'application/json'
}
)
result = response.json()
if result['cancelled']:
print(f"Job {job_id} was successfully cancelled")
else:
print(f"Failed to cancel job: {result['message']}")
Notes
- Jobs can only be cancelled if they are in a cancellable state (e.g., pending, submitted, starting, or running)
- Jobs that have already completed, failed, or been previously cancelled cannot be cancelled
- The cancellation is asynchronous - the job may take a moment to fully stop after receiving the cancellation request