メッセージバッチの結果を取得
GET/v1/messages/batches/{message_batch_id}/results
メッセージバッチの結果を.jsonlファイルとしてストリーミングします。
ファイルの各行は、メッセージバッチ内の単一リクエストの結果を含むJSONオブジェクトです。結果がリクエストと同じ順序であることは保証されません。結果とリクエストを照合するにはcustom_idフィールドを使用してください。
Message Batches APIの詳細については、ユーザーガイドをご覧ください。
メッセージバッチの結果を取得
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 stream = await client.beta.messages.batches.results("message_batch_id");
for await (const betaMessageBatchIndividualResponse of stream) {
console.log(betaMessageBatchIndividualResponse.custom_id);
}