Step-by-step answer
Core 75–90 min7 stepsBuild a resumable batch extraction job
A batch extraction job that keeps all of its state in SQLite, derives each custom_id from the document and prompt version, collects open batches before submitting anything, and treats each result type differently. It runs against an in-memory fake of the Claude Message Batches API for free, and against OpenRouter's Batch API through an adapter. A 10,000-document sweep shows the 1-hour cache breaking even at 50% hit rate.
Back to the exercise