Anthropic Messages Batches API #1

Open
opened 2026-08-03 16:55:14 -07:00 by kalmiya · 0 comments
Owner

Kanban ticket: t_7ec0a1c1
Board: hermes-anthropic-api


Task t_7ec0a1c1: Anthropic Messages Batches API
status: ready
assignee: -
workspace: scratch
max-retries: 2 (default)
created: 2026-08-03 16:53 by kalmiya

Body:
Anthropic Messages Batches endpoints — full parity with Anthropic's own shape.

Endpoints (all under /v1/messages/batches):

  • POST /v1/messages/batches — create batch from a list of requests[] (each with custom_id + params mirroring the Messages request body). Response: {"id": "msgbatch_...", "type": "message_batch", "processing_status": "in_progress", "request_counts": {...}, "created_at": ..., "expires_at": ...}.
  • GET /v1/messages/batches/{message_batch_id} — retrieve.
  • GET /v1/messages/batches/{message_batch_id}/results — stream a .jsonl of per-request results.
  • GET /v1/messages/batches — paginated list with limit, before_id, after_id.
  • DELETE /v1/messages/batches/{message_batch_id} — cancel an in-progress batch.

Implementation note: Hermes's batch infrastructure (batch_runner.py) already exists. Reuse it; the adapter mostly translates the Anthropic request shape into a list of Messages calls and shapes the responses back. Storage: SQLite (reuse the ResponseStore pattern from api_server.py).

Result shape per request in the JSONL stream:

{"custom_id": "...", "result": {"type": "succeeded", "message": {<Messages API response>}}}

or for failures: {"result": {"type": "errored", "error": {"type": "...", "message": "..."}}}.

Events (1):
[2026-08-03 16:53] created {'assignee': None, 'status': 'ready', 'parents': [], 'tenant': None, 'workspace_kind': 'scratch', 'workspace_path': None, 'branch_name': None, 'project_id': None, 'skills': None, 'goal_mode': None, 'model_override': None, 'provider_override': None}

**Kanban ticket:** `t_7ec0a1c1` **Board:** `hermes-anthropic-api` --- Task t_7ec0a1c1: Anthropic Messages Batches API status: ready assignee: - workspace: scratch max-retries: 2 (default) created: 2026-08-03 16:53 by kalmiya Body: Anthropic Messages Batches endpoints — full parity with Anthropic's own shape. Endpoints (all under `/v1/messages/batches`): - `POST /v1/messages/batches` — create batch from a list of `requests[]` (each with `custom_id` + `params` mirroring the Messages request body). Response: `{"id": "msgbatch_...", "type": "message_batch", "processing_status": "in_progress", "request_counts": {...}, "created_at": ..., "expires_at": ...}`. - `GET /v1/messages/batches/{message_batch_id}` — retrieve. - `GET /v1/messages/batches/{message_batch_id}/results` — stream a `.jsonl` of per-request results. - `GET /v1/messages/batches` — paginated list with `limit`, `before_id`, `after_id`. - `DELETE /v1/messages/batches/{message_batch_id}` — cancel an in-progress batch. Implementation note: Hermes's batch infrastructure (`batch_runner.py`) already exists. Reuse it; the adapter mostly translates the Anthropic request shape into a list of Messages calls and shapes the responses back. Storage: SQLite (reuse the `ResponseStore` pattern from api_server.py). Result shape per request in the JSONL stream: ```json {"custom_id": "...", "result": {"type": "succeeded", "message": {<Messages API response>}}} ``` or for failures: `{"result": {"type": "errored", "error": {"type": "...", "message": "..."}}}`. Events (1): [2026-08-03 16:53] created {'assignee': None, 'status': 'ready', 'parents': [], 'tenant': None, 'workspace_kind': 'scratch', 'workspace_path': None, 'branch_name': None, 'project_id': None, 'skills': None, 'goal_mode': None, 'model_override': None, 'provider_override': None}
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kalmiya/hermes-anthropic-api#1
No description provided.