Cancel Batch
Stop a running batch at /v1/batches//cancel
Overview
Moves avalidating or in_progress batch to cancelling, then cancelled once in-flight requests drain. Requests that already completed stay in the output file and are billed; the rest are written to the error file as batch_cancelled. Cancelling a terminal batch returns 400.Authorizations
Morph API key, passed as Authorization: Bearer sk-.... Create keys at https://www.morphllm.com/dashboard/api-keys.
Path Parameters
Identifies the batch to cancel.
The batch_ prefixed id of a batch that is still validating or in_progress.
"batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c"
Response
The batch, now cancelling (or already terminal if it finished first).
A batch and where it is in its lifecycle.
Batch identifier, batch_ prefixed.
"batch_5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c"
Object type, always batch.
"batch"
The endpoint every line targets. Always /v1/chat/completions.
"/v1/chat/completions"
The file the batch reads its requests from.
"file_9c2c1c3e-5b6a-4f0e-8d0f-2a1b3c4d5e6f"
Always 24h. Requests still queued when the window closes are written to the error file as batch_expired.
"24h"
The key-value pairs you attached at creation, or null.
Unix timestamp (seconds) for when the batch was created.
1780000000
Lifecycle state. completed, failed, expired, and cancelled are terminal. expired and cancelled batches still expose partial output.
validating, in_progress, finalizing, completed, failed, expired, cancelling, cancelled "in_progress"
File holding one BatchOutputLine per request the model answered. Set once the batch is terminal; null before that and when nothing completed.
null
File holding one BatchErrorLine per request that never got a model response. Set once the batch is terminal; null before that and when nothing failed.
null
Unix timestamp (seconds) for when processing started. null until it happens.
1780000012
Unix timestamp (seconds) for when output files started being written. null until it happens.
null
Unix timestamp (seconds) for when the batch completed. null until it happens.
null
Unix timestamp (seconds) for when the batch failed. null until it happens.
null
Unix timestamp (seconds) for when the batch expired. null until it happens.
null
Unix timestamp (seconds) for when the completion window closes. null until it happens.
1780086400
Unix timestamp (seconds) for when cancellation was requested. null until it happens.
null
Unix timestamp (seconds) for when cancellation finished. null until it happens.
null
Progress counters. Advance while the batch is in_progress; final once it is terminal.
Why the batch failed validation, or null.
null
Token totals so far, or null before any request has completed.
The model the batch runs on, once validation has read it from the input file.
"morph-glm53flash"