Our review
Cancels a message batch currently being processed via the Anthropic API.
Strengths
- Provides a clean way to stop batch processing without waiting for completion.
- Immediately returns 'canceling' status and request counts.
- Simple POST call requiring only the batch ID.
Limitations
- Cancellation is not immediate: some non-interruptible requests may still finish.
- Requires prior knowledge of the message_batch_id.
- Only works if the batch is still being processed.
Use this operation when a message batch needs to be stopped before completion, such as for error handling or priority changes.
Avoid using it to cancel individual requests or when absolute immediate cancellation is needed.
Security analysis
SafeThe skill provides documentation for a POST endpoint to cancel a message batch, using a localhost mock server. No dangerous commands, secrets handling, or execution risks are present. It is purely informational.
No concerns found
Examples
Cancel the message batch with ID msgbatch_013Zva2CMHLNnXjNJJKqJ2EF.Stop the processing of batch msgbatch_013Zva2CMHLNnXjNJJKqJ2EF using the Anthropic API.Cancel Message Batch
Initiate cancellation of a Message Batch that is currently being processed. The batch enters a canceling state and any in-progress, non-interruptible requests may still complete.
API Details
- API: Anthropic Message Batches API
- Method: POST
- Path:
/messages/batches/{message_batch_id}/cancel - Operation ID:
cancelMessageBatch - OpenAPI: anthropic-message-batches-api-openapi.yml
Sandbox
Mock server URL: http://localhost:8080/rest/anthropic-message-batches-api/1.0.0/messages/batches/{message_batch_id}/cancel
Required Headers
anthropic-version: 2023-06-01x-api-key: {api-key}
Path Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| message_batch_id | string | Yes | Unique identifier of the message batch to cancel |
Example Request
curl -X POST "http://localhost:8080/rest/anthropic-message-batches-api/1.0.0/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/cancel" \
-H "anthropic-version: 2023-06-01" \
-H "x-api-key: your-api-key"
Example Response
{
"id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
"type": "message_batch",
"processing_status": "canceling",
"request_counts": {
"processing": 50,
"succeeded": 40,
"errored": 5,
"canceled": 5,
"expired": 0
},
"created_at": "2024-08-20T18:37:24Z",
"cancel_initiated_at": "2024-08-20T19:00:00Z"
}
Instructions
When the user asks to cancel or stop a message batch, use this operation by making a POST request to /messages/batches/{message_batch_id}/cancel. Note that cancellation is not immediate — the batch enters canceling status and some requests may still complete.
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.