Delete a message batch
/v1/messages/batches/{batchId}Delete a message batch.
Compatible with Anthropic's Delete Message Batch API: deletes an ended batch and its results at Anthropic and returns Anthropic's answer. With a virtual key, the batch is billed first if it has not been yet; a batch that cannot be billed is not deleted. Only a batch the key created is found; any other id is a 404.
Errors are in Anthropic's shape: 400 for a non-Anthropic or PLATFORM key or x-config; 401 for a missing or invalid credential; 403 for a disabled or expired key; 404 for an unknown batch.
Authorization
AuthorizationBearer <slug>.<secret>A virtual key's API key (
vk-....<secret>), asAuthorization: Bearer. What the OpenAI SDK sends from itsapi_key. Used by the inference endpoints.- or
x-virtual-keyheaderA virtual key's API key in the
x-virtual-keyheader, for clients that keepAuthorizationfor something else. - or
x-api-keyheaderDirect credentials: the provider's own API key in
x-api-key, with the provider named inx-provider(for exampleopenai). On/v1/messagesa virtual key is accepted inx-api-keytoo, which is what the Claude SDK sends.
Path parameters
batchIdstringrequiredthe batch id (
msgbatch_...)
Headers
x-providerstringWith direct credentials: the provider
x-api-keybelongs to, for exampleopenaioranthropic(case and dashes are normalised). Not used with a virtual key.anthropic-betastringAnthropic beta features, comma-separated (for example
context-management-2025-06-27). Forwarded to Anthropic and Claude on Vertex only; at most 32 names of lower-case letters, digits and dashes.