> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit a batch inference job

> Submits a batch of queries for asynchronous processing. Returns immediately with a job ID that can be used to track progress and retrieve results…

Submits a batch of queries for asynchronous processing. Returns immediately
with a job ID that can be used to track progress and retrieve results.
**Use Cases**

* Processing large datasets that exceed single-request timeouts
* Running inference on multiple queries in parallel
* Background processing without blocking the client
  **Example**

```bash theme={null}
curl -X POST 'https://api.nsr.stateset.com/api/v1/jobs/batch-infer' \
-H 'X-API-Key: your-api-key' \
-H 'Content-Type: application/json' \
-d '&#123;'inputs': ['query 1', 'query 2', 'query 3'], 'max_depth': 5&#125;'
```

**Required scope:** `write`

### Request body

`BatchInferRequest`

<ParamField body="include_explanation" type="boolean">
  Include explanations
</ParamField>

<ParamField body="inputs" type="string[]" required>
  List of input queries
</ParamField>

<ParamField body="max_depth" type="integer">
  Maximum reasoning depth
</ParamField>

### Response

`JobSubmitResponse`

<ResponseField name="job_id" type="string" required>
  Job identifier for tracking
</ResponseField>

<ResponseField name="status" type="JobStatus" required />

<ResponseField name="total_items" type="integer" required>
  Estimated items to process
</ResponseField>

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `202` | Job submitted successfully                         |
| `400` | Invalid request - no inputs or too many items      |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |
| `503` | Service unavailable - job queue full               |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/jobs/batch-infer' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "include_explanation": true,
    "inputs": [
      "string"
    ],
    "max_depth": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 202 theme={null}
  {
    "job_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "total_items": 1
  }
  ```
</ResponseExample>
