OpenAI API

Delete a vector store.

delete
https://api.openai.com/v1/vector_stores/{vector_store_id}

Path Parameters

vector_store_idstringrequired

The ID of the vector store to delete.

Response

200 application/json

OK

DeleteVectorStoreResponse

idstringrequired
deletedbooleanrequired
objectstringrequired

Allowed values:vector_store.deleted

delete/vector_stores/{vector_store_id}
 
200 application/json

Create a vector store file batch.

post
https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches

Path Parameters

vector_store_idstringrequired

The ID of the vector store for which to create a File Batch.

Example:vs_abc123

Body

application/json

CreateVectorStoreFileBatchRequest

* Additional properties are NOT allowed.
file_idsarray[string]required

A list of File IDs that the vector store should use. Useful for tools like file_search that can access files.

>= 1 items<= 500 items

chunking_strategyOne Of
object

The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.

Auto Chunking Strategyobject

The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400.

* Additional properties are NOT allowed.
Show Child Parameters

Response

200 application/json

OK

Vector store file batch

A batch of files attached to a vector store.

idstringrequired

The identifier, which can be referenced in API endpoints.

objectstringrequired

The object type, which is always vector_store.file_batch.

Allowed values:vector_store.files_batch

created_atintegerrequired

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

vector_store_idstringrequired

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

statusstringrequired

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

Allowed values:in_progresscompletedcancelledfailed

file_countsobjectrequired
Show Child Parameters
post/vector_stores/{vector_store_id}/file_batches

Body

{ "file_ids": [ "[]" ] }
 
200 application/json

Retrieves a vector store file batch.

get
https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}

Path Parameters

vector_store_idstringrequired

The ID of the vector store that the file batch belongs to.

Example:vs_abc123

batch_idstringrequired

The ID of the file batch being retrieved.

Example:vsfb_abc123

Response

200 application/json

OK

Vector store file batch

A batch of files attached to a vector store.

idstringrequired

The identifier, which can be referenced in API endpoints.

objectstringrequired

The object type, which is always vector_store.file_batch.

Allowed values:vector_store.files_batch

created_atintegerrequired

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

vector_store_idstringrequired

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

statusstringrequired

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

Allowed values:in_progresscompletedcancelledfailed

file_countsobjectrequired
Show Child Parameters
get/vector_stores/{vector_store_id}/file_batches/{batch_id}
 
200 application/json

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

post
https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel

Path Parameters

vector_store_idstringrequired

The ID of the vector store that the file batch belongs to.

batch_idstringrequired

The ID of the file batch to cancel.

Response

200 application/json

OK

Vector store file batch

A batch of files attached to a vector store.

idstringrequired

The identifier, which can be referenced in API endpoints.

objectstringrequired

The object type, which is always vector_store.file_batch.

Allowed values:vector_store.files_batch

created_atintegerrequired

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

vector_store_idstringrequired

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

statusstringrequired

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

Allowed values:in_progresscompletedcancelledfailed

file_countsobjectrequired
Show Child Parameters
post/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel
 
200 application/json

Returns a list of vector store files in a batch.

get
https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files

Query Parameters

limitinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Default:20

orderstring

Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

Allowed values:ascdesc

Default:desc

afterstring

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

beforestring

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

filterstring

Filter by file status. One of in_progress, completed, failed, cancelled.

Allowed values:in_progresscompletedfailedcancelled

Path Parameters

vector_store_idstringrequired

The ID of the vector store that the files belong to.

batch_idstringrequired

The ID of the file batch that the files belong to.

Response

200 application/json

OK

ListVectorStoreFilesResponse

objectstringrequired

Example:list

dataarray[object]required

A list of files attached to a vector store.

Show Child Parameters
first_idstringrequired

Example:file-abc123

last_idstringrequired

Example:file-abc456

has_morebooleanrequired

Example:false

get/vector_stores/{vector_store_id}/file_batches/{batch_id}/files
 
200 application/json