Docs
Capabilities

Message Batches

Submit many message requests as one batch and pull results when it ends

Message Batches let you submit a set of message requests as a single job, then retrieve the results when processing finishes. The shape follows the Anthropic Message Batches API.

Batches run on the Anthropic-compatible surface at /v1/messages/batches. The OpenAI-style /v1/batches endpoint is not offered, so use the Anthropic batch endpoints below.

Create a batch

POST /v1/messages/batches takes a requests array. Each entry has a custom_id you choose and a params object holding the same body you would send to /v1/messages.

curl https://api.ablatic.ai/v1/messages/batches \
  -H "x-api-key: $ABLATIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "requests": [
      {
        "custom_id": "req-1",
        "params": {
          "model": "talos",
          "max_tokens": 1024,
          "messages": [{ "role": "user", "content": "Summarize Q1." }]
        }
      },
      {
        "custom_id": "req-2",
        "params": {
          "model": "talos",
          "max_tokens": 1024,
          "messages": [{ "role": "user", "content": "Summarize Q2." }]
        }
      }
    ]
  }'

Send an Idempotency-Key header to make a create call safe to retry.

Manage a batch

GET    /v1/messages/batches/{id}          retrieve one batch
GET    /v1/messages/batches               list batches
POST   /v1/messages/batches/{id}/cancel   cancel a batch
DELETE /v1/messages/batches/{id}          delete a batch
GET    /v1/messages/batches/{id}/results  stream results

Read results

When a batch reaches processing_status of "ended", fetch its results endpoint. The body streams as application/x-ndjson, one JSON result per line.

Limits

  • Per batch: up to 100000 requests and 256 MiB.
  • Per user: up to 50 batches in flight at once.
  • Results stay available for 29 days.

Each entry inside params is a standard Messages request, so max_tokens is required there. See the Anthropic compatibility page for the full body.

Next