Batches

Get a batch by id

Changed on

Returns one batch with its status, priority and request counts, plus its usage once any is recorded and the output and error file ids once written. Poll it to track progress.

Requires the batch.read permission. See Permissions for the roles and API key permissions that include it.

get/v1/batches/{id}

Request

  • Base URL
    https://inference.openrelay.inc
  • URL
    https://inference.openrelay.inc/v1/batches/{id}
  • Auth
    HTTP bearer

Path parameters

idstring required

Response

OK

cancelled_atinteger
completed_atinteger
completion_window'24h' required
created_atinteger required

Unix timestamp (seconds).

endpointstring required

The API family every record in the batch calls.

error_file_idstring

Present once results are written; fetch its content for failed records, the records rejected at create included.

expired_atinteger
expires_atinteger

When the completion window closes (created_at + 24h).

failed_atinteger
idstring required

Batch id (batch_…).

in_progress_atinteger nullable required

Unix timestamp (seconds) when the batch's first requests started running. Always present and null until then, so an in_progress batch with a null in_progress_at is still queued for GPU capacity.

input_file_idstring required
metadataobject

Your key-value pairs, echoed back unchanged.

modelstring

The model every record runs: the first accepted record's, set when the batch is created.

object'batch' required
output_file_idstring

Present once results are written; fetch its content for successful records.

priority'standard' | 'expedited' required

The scheduling tier this batch runs and is billed at. Batches created before the tier existed read as standard.

rejected_countinteger

Only on the create answer: how many records the create rejected. Read the rejected count here, not from request_counts.failed, which also counts the records that failed running when the create answered after its batch already ran.

rejected_records_file_idstring

Only on the create answer, and only when the create rejected records: the file holding every rejected record (purpose batch_rejections), one BatchRecordRejection per line, in input order. Fetch it with the file content call.

status'validating' | 'in_progress' | 'finalizing' | 'completed' | 'failed' | 'expired' | 'cancelling' | 'cancelled' required

Lifecycle state. validating → in_progress → finalizing → completed | failed | expired; cancelling → cancelled. A batch is in_progress while it waits for GPU capacity too; in_progress_at says when its requests started running.

Changes

    • info

      added the non-success response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status