interface Batch {
    completion_window: string;
    created_at: number;
    endpoint: string;
    id: string;
    input_file_id: string;
    object: "batch";
    status:
        | "completed"
        | "failed"
        | "cancelled"
        | "expired"
        | "in_progress"
        | "cancelling"
        | "validating"
        | "finalizing";
    cancelled_at?: number;
    cancelling_at?: number;
    completed_at?: number;
    error_file_id?: string;
    errors?: Errors;
    expired_at?: number;
    expires_at?: number;
    failed_at?: number;
    finalizing_at?: number;
    in_progress_at?: number;
    metadata?: unknown;
    output_file_id?: string;
    request_counts?: BatchRequestCounts;
}

Properties

completion_window: string

The time frame within which the batch should be processed.

created_at: number

The Unix timestamp (in seconds) for when the batch was created.

endpoint: string

The OpenAI API endpoint used by the batch.

id: string
input_file_id: string

The ID of the input file for the batch.

object: "batch"

The object type, which is always batch.

status:
    | "completed"
    | "failed"
    | "cancelled"
    | "expired"
    | "in_progress"
    | "cancelling"
    | "validating"
    | "finalizing"

The current status of the batch.

cancelled_at?: number

The Unix timestamp (in seconds) for when the batch was cancelled.

cancelling_at?: number

The Unix timestamp (in seconds) for when the batch started cancelling.

completed_at?: number

The Unix timestamp (in seconds) for when the batch was completed.

error_file_id?: string

The ID of the file containing the outputs of requests with errors.

errors?: Errors
expired_at?: number

The Unix timestamp (in seconds) for when the batch expired.

expires_at?: number

The Unix timestamp (in seconds) for when the batch will expire.

failed_at?: number

The Unix timestamp (in seconds) for when the batch failed.

finalizing_at?: number

The Unix timestamp (in seconds) for when the batch started finalizing.

in_progress_at?: number

The Unix timestamp (in seconds) for when the batch started processing.

metadata?: unknown

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

output_file_id?: string

The ID of the file containing the outputs of successfully executed requests.

request_counts?: BatchRequestCounts

The request counts for different statuses within the batch.