capabilities.work

Cancel a Message Batch and Confirm

A 3-step recipe with Anthropic. We can help you get access.

Recipe · 3 steps

Cancel a Message Batch and Confirm

Create a batch, cancel it, and poll until it finalizes.

  1. Create a new message batch to demonstrate the cancellation lifecycle.
  2. Initiate cancellation of the batch. The batch enters a canceling state while in-progress, non-interruptible requests are allowed to finish.
  3. Poll the batch status until it leaves the canceling state and reaches ended. Branch back to poll again while the batch is still canceling.
What you'll need to have ready
  • apiKey: A valid Anthropic API key sent in the x-api-key header.
  • requests: The array of individual batch requests, each with a custom_id and a params object (model, max_tokens, messages).
For your developer

Arazzo workflow anthropic:cancel-and-confirm-batch, 3 operations: createMessageBatch → cancelMessageBatch → retrieveMessageBatch. Specs on APIs.io.