List message batches
/v1/messages/batchesList message batches.
Compatible with Anthropic's List Message Batches API: the batches this virtual key created, newest first, each read live from Anthropic, as {"data", "has_more", "first_id", "last_id"}. A batch deleted at Anthropic directly is left out. Needs a virtual key: with a raw Anthropic key, list batches at Anthropic (400 here).
Errors are in Anthropic's shape: 400 for a limit outside 1 to 100, both before_id and after_id set, a non-Anthropic or PLATFORM key, or x-config; 401 for a missing or invalid credential; 403 for a disabled or expired key.
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.
Query parameters
before_idstringpage cursor: return the batches just before (newer than) this batch id
after_idstringpage cursor: return the batches just after (older than) this batch id
limitinteger<int32>how many batches to return, 1 to 100 (default 20)
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.