---
title: "Create an Anthropic Message Batch"
method: POST
path: "/v1/messages/batches"
tags: ["Anthropic"]
---

# Create an Anthropic Message Batch

`POST /v1/messages/batches`

## Request

- Base URL: `https://api.nano-gpt.com/api`
- URL: `https://api.nano-gpt.com/api/v1/messages/batches`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Submit 1–100,000 native Claude requests directly to Anthropic at batch token rates. All requests must use the same supported Claude model and include max_tokens. NanoGPT reserves account balance at creation and settles actual billable usage. Subscription included tokens do not apply. Input and stored normalized input must each fit within 200 MiB. Native custom tools, thinking, prompt caching, images and documents are supported where the model supports them. Streaming generation, provider-hosted tools, MCP servers, containers, provider-managed files and video blocks are rejected. Keys or teams requiring Zero Data Retention cannot create batches. See https://docs.nano-gpt.com/api-reference/endpoint/batches#anthropic-message-batches.

## Headers

- `Idempotency-Key` string
- `anthropic-beta` string

## Request body

- AnthropicMessageBatchCreate
  - `requests` object[], required
    - `custom_id` string, required
    - `params` AnthropicMessageBatchRequest, required: Native Messages parameters for one supported Claude model. The first message must be a user turn. Use the top-level system field for a system prompt. Provider-specific generation fields remain subject to model support and native batch restrictions.
      - `model` string, required: Supported Claude model ID. Use the same model for all requests in the batch.
      - `max_tokens` integer, required: Required output-token cap. The selected model can impose a lower maximum.
      - `messages` object[], required
        - `role` 'user' | 'assistant', required
        - `content` union, required
          - string
          - object[]
      - `system` union
        - string
        - object[]
      - `stream` false
      - `tools` object[]: Custom tool definitions only; hosted tools are rejected.
      - `thinking` object: Native thinking generation controls; may vary by request for the same model.
      - `output_config` object

## Response `200`

Created Message Batch

- AnthropicMessageBatch
  - `id` string, required
  - `type` 'message_batch', required
  - `processing_status` 'in_progress' | 'canceling' | 'ended', required
  - `request_counts` AnthropicMessageBatchRequestCounts, required
    - `processing` integer, required
    - `succeeded` integer, required
    - `errored` integer, required
    - `canceled` integer, required
    - `expired` integer, required
  - `created_at` string, date-time, required
  - `expires_at` string, date-time, required
  - `ended_at` string, nullable, required
  - `archived_at` string, nullable, required
  - `cancel_initiated_at` string, nullable, required
  - `results_url` string, uri, nullable, required

## Other responses

- `400`: Anthropic Messages API error response
- `401`: Anthropic Messages API error response
- `409`: Anthropic Messages API error response
- `413`: Anthropic Messages API error response
- `415`: Anthropic Messages API error response
- `429`: Anthropic Messages API error response
- `502`: Anthropic Messages API error response

## Changes

- **2026-11-03** `cc8b07d75689`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/nano-gpt/apis/nanogpt-api/changes/v1/messages/batches/post.md)

---

[API](https://skmtc.dev/nano-gpt/apis/nanogpt-api.md) - [All operations](https://skmtc.dev/nano-gpt/apis/nanogpt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nano-gpt/apis/nanogpt-api/revisions/cc8b07d75689?raw)
