GET
/
list-jobs
/
Listing All Jobs
curl --request GET \
  --url https://api.sutro.sh/list-jobs/ \
  --header 'Authorization: <authorization>'
{
  "jobs": [
    {
      "job_id": "batch_job_12345",
      "status": "succeeded",
      "created_at": "2024-01-15T10:30:00Z",
      "completed_at": "2024-01-15T10:32:15Z",
      "model": "llama-3.1-8b",
      "input_count": 3,
      "priority": 0
    },
    {
      "job_id": "batch_job_12346",
      "status": "running",
      "created_at": "2024-01-15T11:00:00Z",
      "completed_at": null,
      "model": "llama-3.1-8b",
      "input_count": 10,
      "priority": 1
    },
    {
      "job_id": "batch_job_12347",
      "status": "failed",
      "created_at": "2024-01-15T09:45:00Z",
      "completed_at": "2024-01-15T09:46:30Z",
      "model": "llama-3.1-8b",
      "input_count": 5,
      "priority": 0
    }
  ],
  "message": "Successfully retrieved 3 jobs"
}
Using the API directly is not recommended for most users. Instead, we recommend using the Python SDK.
List all current and historical jobs, and associated metadata.

Headers

Authorization
string
required
Your Sutro API key using Key authentication scheme.Format: Key YOUR_API_KEYExample: Authorization: Key sk_live_abc123...

Response

Returns a list of all jobs associated with your account.
jobs
array
A list of jobs you have access to. Each job object contains metadata about the job including job_id, status, creation time, and other relevant information.
message
string
Verbose message for the job’s results
{
  "jobs": [
    {
      "job_id": "batch_job_12345",
      "status": "succeeded",
      "created_at": "2024-01-15T10:30:00Z",
      "completed_at": "2024-01-15T10:32:15Z",
      "model": "llama-3.1-8b",
      "input_count": 3,
      "priority": 0
    },
    {
      "job_id": "batch_job_12346",
      "status": "running",
      "created_at": "2024-01-15T11:00:00Z",
      "completed_at": null,
      "model": "llama-3.1-8b",
      "input_count": 10,
      "priority": 1
    },
    {
      "job_id": "batch_job_12347",
      "status": "failed",
      "created_at": "2024-01-15T09:45:00Z",
      "completed_at": "2024-01-15T09:46:30Z",
      "model": "llama-3.1-8b",
      "input_count": 5,
      "priority": 0
    }
  ],
  "message": "Successfully retrieved 3 jobs"
}

Code Examples

import requests

response = requests.get(
    'https://api.sutro.sh/list-jobs/',
    headers={
        'Authorization': 'Key YOUR_SUTRO_API_KEY'
    }
)

result = response.json()
print(f"Message: {result['message']}")
print(f"Total jobs: {len(result['jobs'])}")

for job in result['jobs']:
    print(f"Job ID: {job['job_id']}")
    print(f"Status: {job['status']}")
    print(f"Model: {job['model']}")
    print(f"Input Count: {job['input_count']}")
    print(f"Created: {job['created_at']}")
    if job['completed_at']:
        print(f"Completed: {job['completed_at']}")
    print("---")

Job Object Fields

Each job in the jobs array contains the following fields:
  • job_id: Unique identifier for the job
  • status: Current status of the job (succeeded, failed, running, pending, etc.)
  • created_at: ISO timestamp of when the job was created
  • completed_at: ISO timestamp of when the job completed (null if still running)
  • model: The model used for the job
  • input_count: Number of inputs processed in the job
  • priority: Priority level of the job (0 or 1)

Notes

  • Jobs are returned in reverse chronological order (newest first)
  • The response includes both active and completed jobs
  • Historical job data is retained for account management and billing purposes