Tips // Claude in practice

Tips for working better with Claude

One short tip at a time, with an example you can copy. Move through them at random or search for what you need.

APIBasicClaude API

Batch if nobody waits for the answer; synchronous if someone does

A nightly report or a weekly audit goes to Batch and costs less; a pre-merge check needs the synchronous API.

According to the guide, Message Batches saves about half the cost and processes within up to 24 hours, with no latency guarantee. The question that decides it is who is waiting for the result. With a custom_id on each request you link the response to the document, and you resend only the ones that failed. Check the current documentation for the discount and the window before quoting them.

Example
Pre-merge check on a PR    -> synchronous (the dev is waiting)
Technical debt report      -> Batch (read in the morning)
Processing 10,000 documents -> Batch
Every request carries "custom_id": "doc-invoice-2024-001"
#batch#costs#architecture