Skip to content
API referenceCreate a message batch

Create a message batch

POST/v1/messages/batches

Create a message batch.

Compatible with Anthropic's Message Batches API: the body is {"requests": [{"custom_id", "params"]}}, where each params is a Messages request, and the answer is Anthropic's batch object. At most 100,000 requests; each custom_id is 1 to 64 letters, digits, - or _ and unique in the batch; stream is not allowed. results_url points at this gateway's results endpoint.

Credentials: as for creating a message, but only for Anthropic: a virtual key with its own Anthropic key (not a PLATFORM key, since a batch is billed after it runs) or a raw Anthropic key. Claude on Vertex, other providers and routing configs (x-config) are a 400.

Before the batch reaches Anthropic, with a virtual key: the key is checked for each model the batch uses (status, expiry, model allowlist, rate limits; the batch counts as one request), the plan's limits apply, and every request is checked by the tool-result scan and the input guardrails (the key's plus x-guardrail). A BLOCK on any request refuses the whole batch with a 422 naming its custom_id; a REDACT is sent redacted. Output guardrails do not run, since Anthropic answers later. The batch is billed to the virtual key, at the batch rate, once it has ended, and attributed to the workspace in x-workspace-id (else the key's). With a raw Anthropic key only the tool-result scan runs (no guardrails), and nothing is recorded or billed.

Errors are in Anthropic's shape: 400 for an invalid batch (naming requests[i]), 401 for a missing or invalid credential, 403 for a disabled or expired key or a model it does not allow, 422 for a guardrail BLOCK, 429 for a rate limit.

Compatible with the Anthropic Message Batches API. The request and response bodies are the provider's own format, passed through by the gateway: see the Anthropic Message Batches API reference for every field. The credentials and headers below are what VectorAxis adds.

Authorization

  • AuthorizationBearer <slug>.<secret>

    A virtual key's API key (vk-....<secret>), as Authorization: Bearer. What the OpenAI SDK sends from its api_key. Used by the inference endpoints.

  • orx-virtual-keyheader

    A virtual key's API key in the x-virtual-key header, for clients that keep Authorization for something else.

  • orx-api-keyheader

    Direct credentials: the provider's own API key in x-api-key, with the provider named in x-provider (for example openai). On /v1/messages a virtual key is accepted in x-api-key too, which is what the Claude SDK sends.

Headers

  • x-providerstring

    With direct credentials: the provider x-api-key belongs to, for example openai or anthropic (case and dashes are normalised). Not used with a virtual key.

  • x-guardrailstring

    A guardrail slug (gr-...) to apply to this request, in addition to any the virtual key carries. A BLOCK is a 422 with x-guardrail-status: BLOCK.

  • anthropic-betastring

    Anthropic 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.

Responses

200application/json
NVIDIA Inception Program member

VectorAxis is built by GK Labs, a member of NVIDIA Inception.