Sign in

Process message batches

documented

Process large volumes of Messages requests asynchronously with 50% cost reduction.

POST /v1/messages/batchesMessagesno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://api.anthropic.com/v1/messages/batches" \
  -X POST \
  -H "X-Api-Key: {{ANTHROPIC_API_KEY}}" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"requests": [{"custom_id": "{{$custom_id}}", "params": {"model": "{{$model}}", "max_tokens": {{$max_tokens}}, "messages": [{"role": "user", "content": "{{$user_message}}"}]}}]}'