Create a Message Batch
POST
/v1/messages/batches?beta=true https://api.anthropic.com
Send a batch of Message creation requests.
The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.
Learn more about the Message Batches API in our user guide
Parameters
header Header Parameters
| Name | Type |
|---|---|
anthropic-beta Optional header to specify the beta version(s) you want to use. To use multiple betas, use a comma separated list like | string |
anthropic-version The version of the Claude API you want to use. Read more about versioning and our version history here. | string |
Request Body
application/json
required
interface BetaCreateMessageBatchParams {
requests:BetaMessageBatchIndividualRequestParams [];
}
requests:
}
Responses
200 application/json
Successful Response
interface BetaMessageBatch {
archived_at: string | null;
cancel_initiated_at: string | null;
created_at: string;
ended_at: string | null;
expires_at: string;
id: string;
processing_status: "in_progress" | "canceling" | "ended";
request_counts:BetaRequestCounts ;
results_url: string | null;
type: "message_batch";
}
archived_at: string | null;
cancel_initiated_at: string | null;
created_at: string;
ended_at: string | null;
expires_at: string;
id: string;
processing_status: "in_progress" | "canceling" | "ended";
request_counts:
results_url: string | null;
type: "message_batch";
}
Client Errors
4XX application/json
Error response.
See our errors documentation for more details.
interface BetaErrorResponse {
error:BetaInvalidRequestError | BetaAuthenticationError | BetaBillingError | BetaPermissionError | BetaNotFoundError | BetaRateLimitError | BetaGatewayTimeoutError | BetaAPIError | BetaOverloadedError ;
request_id: string | null;
type: "error";
}
error:
request_id: string | null;
type: "error";
}