OpenAI API

Returns a list of vector stores.

get
https://api.openai.com/v1/vector_stores

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.

Response

200 application/json

OK

ListVectorStoresResponse

objectstringrequired

Example:list

dataarray[object]required

A vector store is a collection of processed files can be used by the file_search tool.

Show Child Parameters
first_idstringrequired

Example:vs_abc123

last_idstringrequired

Example:vs_abc456

has_morebooleanrequired

Example:false

get/vector_stores
 
200 application/json

Create a vector store.

post
https://api.openai.com/v1/vector_stores

Body

application/json

CreateVectorStoreRequest

* Additional properties are NOT allowed.
file_idsarray[string]

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

<= 500 items

namestring

The name of the vector store.

expires_afterobject

The expiration policy for a vector store.

Show Child Parameters
chunking_strategyOne Of
object

The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. Only applicable if file_ids is non-empty.

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
metadataobject | null

Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.

Response

200 application/json

OK

Vector store

A vector store is a collection of processed files can be used by the file_search tool.

idstringrequired

The identifier, which can be referenced in API endpoints.

objectstringrequired

The object type, which is always vector_store.

Allowed values:vector_store

created_atintegerrequired

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

namestringrequired

The name of the vector store.

usage_bytesintegerrequired

The total number of bytes used by the files in the vector store.

file_countsobjectrequired
Show Child Parameters
statusstringrequired

The status of the vector store, which can be either expired, in_progress, or completed. A status of completed indicates that the vector store is ready for use.

Allowed values:expiredin_progresscompleted

expires_afterobject

The expiration policy for a vector store.

Show Child Parameters
expires_atinteger | null

The Unix timestamp (in seconds) for when the vector store will expire.

last_active_atinteger | nullrequired

The Unix timestamp (in seconds) for when the vector store was last active.

metadataobject | nullrequired

Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.

post/vector_stores

Body

{}
 
200 application/json

Retrieves a vector store.

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

Path Parameters

vector_store_idstringrequired

The ID of the vector store to retrieve.

Response

200 application/json

OK

Vector store

A vector store is a collection of processed files can be used by the file_search tool.

idstringrequired

The identifier, which can be referenced in API endpoints.

objectstringrequired

The object type, which is always vector_store.

Allowed values:vector_store

created_atintegerrequired

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

namestringrequired

The name of the vector store.

usage_bytesintegerrequired

The total number of bytes used by the files in the vector store.

file_countsobjectrequired
Show Child Parameters
statusstringrequired

The status of the vector store, which can be either expired, in_progress, or completed. A status of completed indicates that the vector store is ready for use.

Allowed values:expiredin_progresscompleted

expires_afterobject

The expiration policy for a vector store.

Show Child Parameters
expires_atinteger | null

The Unix timestamp (in seconds) for when the vector store will expire.

last_active_atinteger | nullrequired

The Unix timestamp (in seconds) for when the vector store was last active.

metadataobject | nullrequired

Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.

get/vector_stores/{vector_store_id}
 
200 application/json

Modifies a vector store.

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

Path Parameters

vector_store_idstringrequired

The ID of the vector store to modify.

Body

application/json

UpdateVectorStoreRequest

* Additional properties are NOT allowed.
namestring | null

The name of the vector store.

expires_afterobject

The expiration policy for a vector store.

Show Child Parameters
metadataobject | null

Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.

Response

200 application/json

OK

Vector store

A vector store is a collection of processed files can be used by the file_search tool.

idstringrequired

The identifier, which can be referenced in API endpoints.

objectstringrequired

The object type, which is always vector_store.

Allowed values:vector_store

created_atintegerrequired

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

namestringrequired

The name of the vector store.

usage_bytesintegerrequired

The total number of bytes used by the files in the vector store.

file_countsobjectrequired
Show Child Parameters
statusstringrequired

The status of the vector store, which can be either expired, in_progress, or completed. A status of completed indicates that the vector store is ready for use.

Allowed values:expiredin_progresscompleted

expires_afterobject

The expiration policy for a vector store.

Show Child Parameters
expires_atinteger | null

The Unix timestamp (in seconds) for when the vector store will expire.

last_active_atinteger | nullrequired

The Unix timestamp (in seconds) for when the vector store was last active.

metadataobject | nullrequired

Set of 16 key-value pairs that can be attached to an object. This can be
useful for storing additional information about the object in a structured
format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings
with a maximum length of 512 characters.

post/vector_stores/{vector_store_id}

Body

{}
 
200 application/json

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