Skip to content

Vector Stores

List vector stores
VectorStoreListPage vectorStores().list(VectorStoreListParamsparams = VectorStoreListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores
Create vector store
VectorStore vectorStores().create(VectorStoreCreateParamsparams = VectorStoreCreateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores
Retrieve vector store
VectorStore vectorStores().retrieve(VectorStoreRetrieveParamsparams = VectorStoreRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores/{vector_store_id}
Modify vector store
VectorStore vectorStores().update(VectorStoreUpdateParamsparams = VectorStoreUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores/{vector_store_id}
Delete vector store
VectorStoreDeleted vectorStores().delete(VectorStoreDeleteParamsparams = VectorStoreDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/vector_stores/{vector_store_id}
Search vector store
VectorStoreSearchPage vectorStores().search(VectorStoreSearchParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores/{vector_store_id}/search
ModelsExpand Collapse
class AutoFileChunkingStrategyParam:

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

JsonValue; type "auto"constant"auto"constant

Always auto.

class FileChunkingStrategy: A class that can be one of several variants.union

The strategy used to chunk the file.

class StaticFileChunkingStrategyObject:
JsonValue; type "static"constant"static"constant

Always static.

class OtherFileChunkingStrategyObject:

This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the chunking_strategy concept was introduced in the API.

JsonValue; type "other"constant"other"constant

Always other.

class FileChunkingStrategyParam: A class that can be one of several variants.union

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.

class AutoFileChunkingStrategyParam:

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

JsonValue; type "auto"constant"auto"constant

Always auto.

class StaticFileChunkingStrategyObjectParam:

Customize your own chunking strategy by setting chunk size and chunk overlap.

JsonValue; type "static"constant"static"constant

Always static.

class OtherFileChunkingStrategyObject:

This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the chunking_strategy concept was introduced in the API.

JsonValue; type "other"constant"other"constant

Always other.

class StaticFileChunkingStrategy:
long chunkOverlapTokens

The number of tokens that overlap between chunks. The default value is 400.

Note that the overlap must not exceed half of max_chunk_size_tokens.

long maxChunkSizeTokens

The maximum number of tokens in each chunk. The default value is 800. The minimum value is 100 and the maximum value is 4096.

minimum100
maximum4096
class StaticFileChunkingStrategyObject:
JsonValue; type "static"constant"static"constant

Always static.

class StaticFileChunkingStrategyObjectParam:

Customize your own chunking strategy by setting chunk size and chunk overlap.

JsonValue; type "static"constant"static"constant

Always static.

class VectorStore:

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

String id

The identifier, which can be referenced in API endpoints.

long createdAt

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

FileCounts fileCounts
long cancelled

The number of files that were cancelled.

long completed

The number of files that have been successfully 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.

Optional<Long> lastActiveAt

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

Optional<Metadata> metadata

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.

String name

The name of the vector store.

JsonValue; object_ "vector_store"constant"vector_store"constant

The object type, which is always vector_store.

Status status

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.

Accepts one of the following:
EXPIRED("expired")
IN_PROGRESS("in_progress")
COMPLETED("completed")
long usageBytes

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

Optional<ExpiresAfter> expiresAfter

The expiration policy for a vector store.

JsonValue; anchor "last_active_at"constant"last_active_at"constant

Anchor timestamp after which the expiration policy applies. Supported anchors: last_active_at.

long days

The number of days after the anchor time that the vector store will expire.

minimum1
maximum365
Optional<Long> expiresAt

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

class VectorStoreDeleted:
String id
boolean deleted
JsonValue; object_ "vector_store.deleted"constant"vector_store.deleted"constant

Vector StoresFiles

List vector store files
FileListPage vectorStores().files().list(FileListParamsparams = FileListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores/{vector_store_id}/files
Create vector store file
VectorStoreFile vectorStores().files().create(FileCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores/{vector_store_id}/files
Update vector store file attributes
VectorStoreFile vectorStores().files().update(FileUpdateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores/{vector_store_id}/files/{file_id}
Retrieve vector store file
VectorStoreFile vectorStores().files().retrieve(FileRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores/{vector_store_id}/files/{file_id}
Delete vector store file
VectorStoreFileDeleted vectorStores().files().delete(FileDeleteParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
DELETE/vector_stores/{vector_store_id}/files/{file_id}
Retrieve vector store file content
FileContentPage vectorStores().files().content(FileContentParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores/{vector_store_id}/files/{file_id}/content
ModelsExpand Collapse
class VectorStoreFile:

A list 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 file was created.

Optional<LastError> lastError

The last error associated with this vector store file. Will be null if there are no errors.

Code code

One of server_error, unsupported_file, or invalid_file.

Accepts one of the following:
SERVER_ERROR("server_error")
UNSUPPORTED_FILE("unsupported_file")
INVALID_FILE("invalid_file")
String message

A human-readable description of the error.

JsonValue; object_ "vector_store.file"constant"vector_store.file"constant

The object type, which is always vector_store.file.

Status status

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

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

The total vector store usage in bytes. Note that this may be different from the original file size.

String vectorStoreId

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

Optional<Attributes> attributes

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, booleans, or numbers.

Accepts one of the following:
String
double
boolean
Optional<FileChunkingStrategy> chunkingStrategy

The strategy used to chunk the file.

class VectorStoreFileDeleted:
String id
boolean deleted
JsonValue; object_ "vector_store.file.deleted"constant"vector_store.file.deleted"constant

Vector StoresFile Batches

Create vector store file batch
VectorStoreFileBatch vectorStores().fileBatches().create(FileBatchCreateParamsparams = FileBatchCreateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores/{vector_store_id}/file_batches
Retrieve vector store file batch
VectorStoreFileBatch vectorStores().fileBatches().retrieve(FileBatchRetrieveParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores/{vector_store_id}/file_batches/{batch_id}
Cancel vector store file batch
VectorStoreFileBatch vectorStores().fileBatches().cancel(FileBatchCancelParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel
List vector store files in a batch
FileBatchListFilesPage vectorStores().fileBatches().listFiles(FileBatchListFilesParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
GET/vector_stores/{vector_store_id}/file_batches/{batch_id}/files
ModelsExpand 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.