AI2025년 12월 7일2분 읽기

Anthropic Batch API — 대량 요청 50% 할인 처리

YS
YoungSam
조회 1099

Batch API란

대량의 비동기 요청을 일반 API 대비 50% 저렴한 가격에 처리합니다. 24시간 이내에 결과를 받습니다.

사용법

import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();

const batch = await client.beta.messages.batches.create({
  requests: items.map((item, i) => ({
    custom_id: `req-${i}`,
    params: {
      model: "claude-sonnet-4-20250514",
      max_tokens: 1024,
      messages: [{ role: "user", content: item.prompt }],
    },
  })),
});

// 결과 조회
const result = await client.beta.messages.batches.results(batch.id);

활용 사례

  • 대규모 콘텐츠 생성
  • 데이터 분류/라벨링
  • 번역 배치 작업
AnthropicBatch APICost

댓글 0

아직 댓글이 없습니다.