Skip to main content
POST
Cancel batch prediction

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

batch_prediction_id
string
required

The id of the batch prediction to cancel.

Response

Cancelled or cancelling batch prediction

The batch_prediction object represents an asynchronous batch prediction job.

object
enum<string>
required

The object type, which is always batch_prediction.

Available options:
batch_prediction
id
string
required

The id of the batch prediction.

status
enum<string>
required

Current batch lifecycle state. Terminal states are completed, failed, expired, and cancelled.

Available options:
validating,
failed,
in_progress,
finalizing,
completed,
expired,
cancelling,
cancelled
model
enum<string>
required

LLM model to use for every item in the batch. Model availability is cloud-aware: AWS teamspaces accept Bedrock-native batch-capable models, while GCP teamspaces accept non-Bedrock batch-capable models and reject Bedrock-only ids. Deprecated gemini-2.0-flash is accepted for backward compatibility and automatically runs as gemini-3.1-flash-lite.

Available options:
gemini-2.0-flash,
gemini-2.5-flash,
gemini-2.5-flash-lite,
gemini-3.1-flash-lite,
gemini-3.5-flash,
gemini-2.5-pro,
gemini-3.1-pro-preview,
gpt-4o,
gpt-4o-mini,
gpt-4.1-mini,
gpt-4.1,
gpt-5-mini,
gpt-5,
gpt-5.1,
claude-sonnet-4@20250514,
claude-opus-4-1@20250805,
claude-haiku-4-5@20251001,
claude-sonnet-4-5@20250929,
claude-sonnet-4-6@default,
claude-opus-4-5@20251101,
claude-opus-4-6@default,
claude-opus-4-7,
claude-opus-4-8,
anthropic.claude-haiku-4-5-20251001-v1:0,
anthropic.claude-sonnet-4-5-20250929-v1:0,
anthropic.claude-sonnet-4-6,
anthropic.claude-opus-4-5-20251101-v1:0,
anthropic.claude-opus-4-6-v1,
anthropic.claude-opus-4-7,
anthropic.claude-opus-4-8,
amazon.nova-2-lite-v1:0
completion_window
enum<string>
required

Requested completion window.

Available options:
24h
created_at
string<date-time>
required

ISO timestamp when the batch was created.

expires_at
string<date-time>
required

ISO timestamp when the batch completion window expires.

in_progress_at
string<date-time> | null
required

ISO timestamp when the batch entered in_progress, or null if it has not.

finalizing_at
string<date-time> | null
required

ISO timestamp when the batch entered finalizing, or null if it has not.

completed_at
string<date-time> | null
required

ISO timestamp when the batch reached completed, or null otherwise.

failed_at
string<date-time> | null
required

ISO timestamp when the batch reached failed, or null otherwise.

cancelling_at
string<date-time> | null
required

ISO timestamp when cancellation was requested, or null otherwise.

cancelled_at
string<date-time> | null
required

ISO timestamp when the batch reached cancelled, or null otherwise.

expired_at
string<date-time> | null
required

ISO timestamp when the batch reached expired, or null otherwise.

request_counts
object
required

The sum of processing, succeeded, errored, canceled, and expired equals total.

metadata
object | null
required

Optional metadata map with up to 16 entries. Metadata keys must be 64 characters or fewer and values must be 512 characters or fewer.

error
object | null
required

Batch-level terminal error details for failed, cancelled, or expired batches; otherwise null.

results_url
string<uri-reference> | null
required

Relative URL for the NDJSON results stream once the batch is terminal. This becomes null after retained result lines are cleaned up.