Skip to main content
POST
/
batches
Create a batch
curl --request POST \
  --url https://api.sailresearch.com/v1/batches \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "endpoint": "/v1/responses",
  "label": "my-batch-job",
  "requests": [
    {
      "custom_id": "my-first-request",
      "params": {
        "model": "openai/gpt-oss-20b",
        "max_output_tokens": 1024,
        "input": [
          {
            "role": "user",
            "content": "Hello, world!"
          }
        ]
      }
    },
    {
      "custom_id": "my-second-request",
      "params": {
        "model": "openai/gpt-oss-20b",
        "max_output_tokens": 1024,
        "input": [
          {
            "role": "user",
            "content": "Hello again!"
          }
        ]
      }
    }
  ]
}
'
{
  "id": "batch_abc123",
  "request_counts": 2,
  "created_at": 1741564800,
  "label": "my-batch-job"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
endpoint
enum<string>
required

The API endpoint to use for all requests in the batch. Currently only /v1/responses is supported.

Available options:
/v1/responses
requests
object[]
required

The list of requests in the batch. Min 1, max 100,000 requests. Total request body must not exceed 256 MB.

Required array length: 1 - 100000 elements
label
string

An optional label for the batch. Must be alphanumeric (hyphens and underscores allowed), max 128 characters.

Maximum string length: 128
Pattern: ^[a-zA-Z0-9_-]+$

Response

Batch created.

id
string
required

Unique identifier for the batch.

request_counts
integer
required

Total number of requests in the batch.

created_at
integer
required

Unix timestamp of when the batch was created.

label
string

The label for the batch, if provided.