Skip to content

Cancel vector store file batch

VectorStoreFileBatch vectorStores().fileBatches().cancel(FileBatchCancelParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

ParametersExpand Collapse
FileBatchCancelParams params
String vectorStoreId
Optional<String> batchId
ReturnsExpand Collapse
class VectorStoreFileBatch:

A batch of files attached to a vector store.

String id

The identifier, which can be referenced in API endpoints.

long createdAt

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

FileCounts fileCounts
long cancelled

The number of files that where cancelled.

long completed

The number of files that have been processed.

long failed

The number of files that have failed to process.

long inProgress

The number of files that are currently being processed.

long total

The total number of files.

JsonValue; object_ "vector_store.files_batch"constant"vector_store.files_batch"constant

The object type, which is always vector_store.file_batch.

Status status

The status of the vector store files batch, which can be either in_progress, completed, cancelled or failed.

Accepts one of the following:
IN_PROGRESS("in_progress")
COMPLETED("completed")
CANCELLED("cancelled")
FAILED("failed")
String vectorStoreId

The ID of the vector store that the File is attached to.

Cancel vector store file batch

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.vectorstores.filebatches.FileBatchCancelParams;
import com.openai.models.vectorstores.filebatches.VectorStoreFileBatch;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        FileBatchCancelParams params = FileBatchCancelParams.builder()
            .vectorStoreId("vector_store_id")
            .batchId("batch_id")
            .build();
        VectorStoreFileBatch vectorStoreFileBatch = client.vectorStores().fileBatches().cancel(params);
    }
}
{
  "id": "id",
  "created_at": 0,
  "file_counts": {
    "cancelled": 0,
    "completed": 0,
    "failed": 0,
    "in_progress": 0,
    "total": 0
  },
  "object": "vector_store.files_batch",
  "status": "in_progress",
  "vector_store_id": "vector_store_id"
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "file_counts": {
    "cancelled": 0,
    "completed": 0,
    "failed": 0,
    "in_progress": 0,
    "total": 0
  },
  "object": "vector_store.files_batch",
  "status": "in_progress",
  "vector_store_id": "vector_store_id"
}