inferenceClient.batches.retrieve()

Generated on 13 Nov 2026 from DoTs version v1.24.0

Usage

inferenceClient.batches.retrieve(batchId: string, query?: Record<string, any>): Promise<any>

Description

Returns the current state of a batch job. Poll until status reaches a terminal value (completed, failed, expired, or cancelled).

Parameters

batch_id string required

Example: 0e9d1d35-3d1e-4d66-9a2f-8c7e0f6b3e21

The batch job identifier.

Request Sample

Show Request Sample
import { InferenceClient } from "@digitalocean/dots";

const inferenceClient = new InferenceClient({
    apiKey: process.env.MODEL_ACCESS_KEY!,
});

const response = await inferenceClient.batches.retrieve("your_batch_id");

Response Example

Show Response Example
{
  "batch_id": "0e9d1d35-3d1e-4d66-9a2f-8c7e0f6b3e21",
  "status": "in_progress",
  "provider": "openai",
  "endpoint": "/v1/chat/completions",
  "completion_window": "24h",
  "input_file_id": "a1b2c3d4-e5f6-4789-90ab-cdef12345678",
  "output_file_id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "error_file_id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "request_counts": {
    "total": 10000,
    "completed": 0,
    "failed": 0
  },
  "request_id": "c7e3ad1e-20c3-4e47-9bf2-6f2a4d6a2f11",
  "errors": [
    {
      "code": "invalid_input_file",
      "message": "Line 42: missing required field 'custom_id'.",
      "line": 42
    }
  ],
  "created_at": "2026-04-24T19:19:19Z",
  "in_progress_at": "2026-04-24T19:20:05Z",
  "finalizing_at": "2026-04-24T20:10:42Z",
  "completed_at": "2026-04-24T20:15:30Z",
  "expires_at": "2026-04-25T19:19:19Z",
  "cancelled_at": "2026-04-24T19:45:11Z",
  "failed_at": "2026-04-24T19:50:00Z"
}

More Information

See /v1/batches/{batch_id} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.