Retrieve Message Batch results
client.messages.batches.results(stringmessageBatchID, RequestOptionsoptions?): MessageBatchIndividualResponse | Stream<MessageBatchIndividualResponse>GET/v1/messages/batches/{message_batch_id}/results
Streams the results of a Message Batch as a .jsonl file.
Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the custom_id field to match results to requests.
Learn more about the Message Batches API in our user guide
Retrieve Message Batch results
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});
const messageBatchIndividualResponse = await client.messages.batches.results(
"message_batch_id"
);
console.log(messageBatchIndividualResponse.custom_id);