OpenAI Batch

Cancel an in-progress OpenAI-compatible batch. Already completed requests are not affected.

post/api/v1/batches/{batch_id}/cancel

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/v1/batches/{batch_id}/cancel
  • Auth
    HTTP bearer

Path parameters

batch_idstring required

Batch ID.

Query parameters

provider_idstring required

Provider route with customer-owned credentials, for example openai or parasail.

Headers

X-Data-Respan-Paramsstring

Base64-encoded JSON object of Respan request parameters. Legacy X-Data-Keywordsai-Params is still accepted.

Request body

object required

Response

Batch cancellation initiated.

idstring required

Batch ID.

objectstring
endpointstring
input_file_idstring
output_file_idstring nullable

Output file ID, available when the batch completes.

error_file_idstring nullable

Error file ID, when provider errors are available.

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

Unix timestamp.

in_progress_atinteger nullable
expires_atinteger nullable
finalizing_atinteger nullable
completed_atinteger nullable
failed_atinteger nullable
expired_atinteger nullable
cancelling_atinteger nullable
cancelled_atinteger nullable
metadataobject
errorsunknown

Example response

{
  "id": "batch_abc123",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "input_file_id": "file-abc123",
  "completion_window": "24h",
  "status": "in_progress",
  "created_at": 1710000000,
  "request_counts": {
    "total": 100,
    "completed": 97,
    "failed": 3
  }
}

Changes

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • breaking

      the response property became nullable for the status

    • info

      api operation id openAiBatch_cancelBatch removed and replaced with cancelBatch

    • info

      api tag OpenAI Batch added

    • info

      api tag openAiBatch removed

    • info

      removed subschema #1 subschema #2 from the response property oneOf list for the response status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      added the non-success response with the status

    • info

      the response property became required for the status