[ ABORT TO HUD ]
SEQ. 1

JSONL Construction & Callbacks

📦 Batched API Optimization20 min1300 BASE XP⌨ HANDS-ON LAB

Enterprise-Scale Processing

For large-scale tasks (ETL, bulk summarization) that don't need instant feedback, use the Batch API. You prepare a JSONL file where each line is a standard Messages API request. Anthropic processes this asynchronously, typically within 24 hours (SLA), though usually much faster.

The 50% Efficiency Rule

Because the Batch API allows Anthropic to optimize their GPU routing and timing, they offer a flat 50% discount on all batch tokens. This makes it the only viable solution for processing millions of documents or performing massive content moderation tasks in high-scale enterprises.

⌨ HANDS-ON LABSubmit & Poll a Message Batch
⭐ +200 XP

Two thousand support tickets need summarizing overnight. Submit a Message Batch with custom_ids, poll its status, then pull the JSONL results — at 50% token cost.

1POST two requests (each with a unique custom_id) to the Message Batches endpoint.
2Poll the batch by GETting its ID until processing_status flips to ended.
3Stream the .jsonl results — one line per request, matched back to your inputs by custom_id.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 3 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 3
At what threshold does the Batch API cap total requests per single payload submission?
1,000
10,000
500
Unlimited
JSONL Construction & Callbacks Tutorial | Batched API Optimization — Claude Academy