TokenLab

파일 및 배치

메시지 배치 목록 조회

조직에서 생성한 메시지 배치 목록을 조회합니다.

GET
/v1/messages/batches

개요

이 API를 통해 조직에서 생성한 메시지 배치를 최신순으로 반환합니다. 이 목록은 각 배치에 대해 TokenLab이 마지막으로 기록한 상태를 보여줍니다. 특정 배치를 지금 확인하려면 배치 조회를 참조하세요.

참고 사항

  • limit은 1에서 1000 사이이며 기본값은 20입니다.
  • 페이지를 이동하려면 목록에 있는 배치 ID를 사용하여 after_id(이전 배치) 또는 before_id(최신 배치)를 전달하세요. 두 매개변수를 동시에 보낼 수는 없습니다. 알 수 없는 ID나 다른 쿼리 매개변수를 보낼 경우 TokenLab은 400 오류를 반환합니다.
  • 삭제된 배치는 목록에 포함되지 않습니다.
  • has_more는 추가 배치가 있을 경우 true가 됩니다.

예시

요청

cURL
curl -X GET "https://api.tokenlab.sh/v1/messages/batches?limit=20" \
  -H "x-api-key: sk-your-api-key" \
  -H "anthropic-version: 2023-06-01"

응답 예시

응답

200 OK
{
  "data": [
    {
      "id": "msgbatch_01ABC123",
      "type": "message_batch",
      "processing_status": "ended",
      "request_counts": { "processing": 0, "succeeded": 2, "errored": 0, "canceled": 0, "expired": 0 },
      "ended_at": "2026-11-01T10:20:00Z",
      "created_at": "2026-11-01T10:00:00Z",
      "expires_at": "2026-11-02T10:00:00Z",
      "cancel_initiated_at": null,
      "archived_at": null,
      "results_url": "https://api.tokenlab.sh/v1/messages/batches/msgbatch_01ABC123/results"
    }
  ],
  "first_id": "msgbatch_01ABC123",
  "last_id": "msgbatch_01ABC123",
  "has_more": false
}

주요 필드

dataarray
메시지 배치 목록(최신순).
first_idstring|null
data 내 첫 번째 배치의 ID입니다.
last_idstring|null
data 내 마지막 배치의 ID입니다.
has_moreboolean
has_more가 true이면 추가 배치를 사용할 수 있습니다.

인증

BearerAuth
AuthorizationBearer <token>

API 키 인증입니다. Dashboard > API > API Keys에서 API 키를 생성하거나 관리하십시오.

위치: header

쿼리 매개변수

before_id?string

해당 배치 ID 이전의 배치를 반환합니다. after_id와 함께 사용할 수 없습니다.

after_id?string

해당 배치 ID 이후의 배치를 반환합니다. before_id와 함께 사용할 수 없습니다.

limit?integer

반환할 최대 배치 수

범위1 <= value <= 1000
기본값20

응답

application/json

application/json

application/json

application/json

application/json

application/json

application/json