Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Delete vector store file

VectorStoreFileDeleted vectorStores().files().delete(params, requestOptions = RequestOptions.none())
DELETE
/vector_stores/{vector_store_id}/files/{file_id}

Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

Delete vector store file

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.vectorstores.files.FileDeleteParams;
import com.openai.models.vectorstores.files.VectorStoreFileDeleted;

public final class Main {
    private Main() {}

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

        FileDeleteParams params = FileDeleteParams.builder()
            .vectorStoreId("vector_store_id")
            .fileId("file_id")
            .build();
        VectorStoreFileDeleted vectorStoreFileDeleted = client.vectorStores().files().delete(params);
    }
}
Response example
{
  "id": "file-abc123",
  "object": "vector_store.file.deleted",
  "deleted": true
}
Parameters
FileDeleteParams params
String vectorStoreId
Optional<String> fileId
Returns
class VectorStoreFileDeleted:
String id
boolean deleted
JsonValue; object_
constant
constant
Returns Examples
Response example
{
  "id": "file-abc123",
  "object": "vector_store.file.deleted",
  "deleted": true
}