Claude Platform Docs

擷取訊息批次

GET/v1/messages/batches/{message_batch_id}

此端點具冪等性,可用於輪詢訊息批次是否完成。若要存取訊息批次的結果,請對回應中的 results_url 欄位發出請求。

在我們的使用者指南中進一步瞭解 Message Batches API

Path parameters
message_batch_id: string

ID of the Message Batch.

Returns
MessageBatch object{ id, archived_at, cancel_initiated_at, 7 more }
擷取訊息批次
curl https://api.anthropic.com/v1/messages/batches/$MESSAGE_BATCH_ID \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"
Returns Examples
Response 200
{
  "id": "msgbatch_013Zva2CMHLNnXjNJJKqJ2EF",
  "archived_at": "2024-08-20T18:37:24.100435Z",
  "cancel_initiated_at": "2024-08-20T18:37:24.100435Z",
  "created_at": "2024-08-20T18:37:24.100435Z",
  "ended_at": "2024-08-20T18:37:24.100435Z",
  "expires_at": "2024-08-20T18:37:24.100435Z",
  "processing_status": "in_progress",
  "request_counts": {
    "canceled": 10,
    "errored": 30,
    "expired": 10,
    "processing": 100,
    "succeeded": 50
  },
  "results_url": "https://api.anthropic.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results",
  "type": "message_batch"
}