---
title: "Create message batch (Anthropic-compatible)"
method: POST
path: "/v1/messages/batches"
tags: ["Anthropic"]
---

# Create message batch (Anthropic-compatible)

`POST /v1/messages/batches`

## Request

- Base URL: `https://api.tokenlab.sh`
- URL: `https://api.tokenlab.sh/v1/messages/batches`
- Auth: HTTP bearer

Creates a native Anthropic Message Batch. Requests use the same Anthropic message parameters as /v1/messages.

## Headers

- `X-TokenLab-Delivery-Policy` 'auto' | 'verified' | 'official'

## Request body

- AnthropicMessageBatchCreateRequest
  - `requests` object[], required
    - `custom_id` string, required: Client-supplied identifier for this batch item
    - `params` AnthropicMessagesRequest, required
      - `model` string, required: Model to use (e.g., claude-sonnet-4-6)
      - `max_tokens` integer, required: Maximum number of tokens to generate
      - `messages` object[], required: Messages in the conversation
        - `role` 'user' | 'assistant', required
        - `content` union, required
          - string
          - object[]
            - `type` 'text' | 'image'
            - `text` string
            - `source` object
              - …
      - `system` string: System prompt
      - `temperature` number
      - `top_p` number
      - `top_k` integer
      - `stop_sequences` string[]
      - `stream` boolean
      - `tools` object[]: Tool definitions available to the model.
      - `tool_choice` union: Tool choice policy or explicit tool selection.
        - string
        - object
      - `metadata` object: Request metadata echoed into downstream logs or traces when supported.
      - `thinking` object: Thinking configuration for compatible Anthropic-style models.
      - `stream_options` object: Streaming options such as usage chunk inclusion.
      - `service_tier` string: Service tier hint where supported by the model.

## Response `200`

Created message batch

- AnthropicMessageBatch: Anthropic-compatible message batch object.
  - `id` string, required: Message batch identifier
  - `type` 'message_batch', required
  - `processing_status` string, required: Current processing status for the batch
  - `request_counts` object, required: Request count summary for the batch
  - `ended_at` string, nullable, required: ISO timestamp when processing ended, when available
  - `created_at` string, required: ISO timestamp when the batch was created, when available
  - `expires_at` string, required: ISO timestamp when the batch expires, when available
  - `cancel_initiated_at` string, nullable, required: ISO timestamp when cancellation was initiated, when available
  - `archived_at` string, nullable, required: ISO timestamp when the batch was archived, when available
  - `results_url` string, nullable, required: Results URL, when available

## Other responses

- `400`: Bad Request - Invalid input
- `401`: Unauthorized - Invalid or missing API key
- `402`: Payment Required - Insufficient balance or quota exceeded
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error
- `502`: Service Error
- `503`: The requested Delivery tier is temporarily unavailable.

---

[API](https://skmtc.dev/tokenlab/apis/tokenlab-ai-gateway.md) · [All operations](https://skmtc.dev/tokenlab/apis/tokenlab-ai-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/tokenlab/apis/tokenlab-ai-gateway/revisions/3208bfbcda22?raw)
