> ## 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.

# Checking Job Status

> Retrieve the status of a batch inference job by its job_id

<Warning>Using the API directly is not recommended for most users. Instead, we recommend using the [Python SDK](/python-sdk/setup).</Warning>

Retrieve the status of a batch inference job by its job\_id.

## Request Parameters

<ParamField path="job_id" type="string" required>
  The job\_id returned when you submitted the batch inference job
</ParamField>

## Headers

<ParamField header="Authorization" type="string" required>
  Your Sutro API key using Key authentication scheme.

  Format: `Key YOUR_API_KEY`

  Example: `Authorization: Key sk_live_abc123...`
</ParamField>

## Response

Returns the current status and details of the batch inference job.

<ResponseField name="message" type="string">
  Message describing the job's current status
</ResponseField>

<ResponseField name="job_status" type="string">
  The current status of the job. See status values below
</ResponseField>

<ResponseField name="metadata" type="object">
  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
</ResponseField>

### 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

<ResponseExample>
  ```json Successful Job theme={null}
  {
    "message": "Job completed successfully",
    "job_status": "succeeded",
    "metadata": {}
  }
  ```

  ```json Running Job theme={null}
  {
    "message": "Job is currently running",
    "job_status": "running",
    "metadata": {}
  }
  ```

  ```json Failed Job theme={null}
  {
    "message": "Job failed during initialization",
    "job_status": "failed",
    "metadata": {
      "failure_reason": "Invalid model specified",
      "additional_context": "Model 'invalid-model' not found in available models list"
    }
  }
  ```
</ResponseExample>

## Code Examples

<CodeGroup>
  ```python Python theme={null}
  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')}")
  ```

  ```javascript Node.js theme={null}
  const jobId = 'batch_job_12345';

  const response = await fetch(`https://api.sutro.sh/job-status/${jobId}`, {
    method: 'GET',
    headers: {
      'Authorization': 'Key YOUR_SUTRO_API_KEY'
    }
  });

  const result = await response.json();
  console.log(`Job Status: ${result.job_status}`);
  console.log(`Message: ${result.message}`);

  if (result.job_status === 'failed') {
    console.log(`Failure Reason: ${result.metadata?.failure_reason || 'Unknown'}`);
  }
  ```

  ```curl cURL theme={null}
  curl -X GET https://api.sutro.sh/job-status/batch_job_12345 \
    -H "Authorization: Key YOUR_SUTRO_API_KEY"
  ```
</CodeGroup>
