Skip to main content
POST
/
v1
/
batches
/
{batch_id}
/
cancel
Cancel Openai Batch
curl --request POST \
  --url https://api.deepinfra.com/v1/batches/{batch_id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "endpoint": "<string>",
  "input_file_id": "<string>",
  "completion_window": "<string>",
  "status": "<string>",
  "created_at": 123,
  "expires_at": 123,
  "object": "batch",
  "errors": {
    "object": "list",
    "data": [
      {
        "code": "<string>",
        "line": 123,
        "message": "<string>",
        "param": "<string>"
      }
    ]
  },
  "output_file_id": "<string>",
  "error_file_id": "<string>",
  "in_progress_at": 123,
  "finalizing_at": 123,
  "completed_at": 123,
  "failed_at": 123,
  "expired_at": 123,
  "cancelling_at": 123,
  "cancelled_at": 123,
  "request_counts": {
    "total": 0,
    "completed": 0,
    "failed": 0
  },
  "metadata": {},
  "model": "<string>",
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "cached_tokens": 0
    },
    "output_tokens": 0,
    "output_tokens_details": {
      "reasoning_tokens": 0
    },
    "total_tokens": 0
  }
}

Authorizations

Authorization
string
header
required

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

Headers

xi-api-key
string | null
x-api-key
string | null

Path Parameters

batch_id
string
required

Response

Successful Response

id
string
required

The batch ID.

endpoint
string
required

The API endpoint used for the batch.

input_file_id
string
required

The ID of the input file for the batch.

completion_window
string
required

The time frame within which the batch should be processed.

status
string
required

The current status of the batch.

created_at
integer
required

The Unix timestamp of when the batch was created.

expires_at
integer
required

The Unix timestamp of when the batch will expire.

object
string
default:batch

The object type, which is always batch.

Allowed value: "batch"
errors
BatchErrors · object

Errors that occurred during the batch.

output_file_id
string | null

The ID of the output file.

error_file_id
string | null

The ID of the error file.

in_progress_at
integer | null

The Unix timestamp of when the batch started processing.

finalizing_at
integer | null

The Unix timestamp of when the batch started finalizing.

completed_at
integer | null

The Unix timestamp of when the batch completed.

failed_at
integer | null

The Unix timestamp of when the batch failed.

expired_at
integer | null

The Unix timestamp of when the batch expired.

cancelling_at
integer | null

The Unix timestamp of when the batch started cancelling.

cancelled_at
integer | null

The Unix timestamp of when the batch was cancelled.

request_counts
BatchRequestCounts · object

Request counts for the batch.

metadata
Metadata · object

Metadata associated with the batch.

model
string | null

The model used for the batch.

usage
BatchUsage · object

Token usage accumulated for the batch.