Skip to content

Vector Stores

List vector stores
client.VectorStores.List(ctx, query) (*CursorPage[VectorStore], error)
GET/vector_stores
Create vector store
client.VectorStores.New(ctx, body) (*VectorStore, error)
POST/vector_stores
Retrieve vector store
client.VectorStores.Get(ctx, vectorStoreID) (*VectorStore, error)
GET/vector_stores/{vector_store_id}
Modify vector store
client.VectorStores.Update(ctx, vectorStoreID, body) (*VectorStore, error)
POST/vector_stores/{vector_store_id}
Delete vector store
client.VectorStores.Delete(ctx, vectorStoreID) (*VectorStoreDeleted, error)
DELETE/vector_stores/{vector_store_id}
Search vector store
client.VectorStores.Search(ctx, vectorStoreID, body) (*Page[VectorStoreSearchResponse], error)
POST/vector_stores/{vector_store_id}/search
ModelsExpand Collapse
type AutoFileChunkingStrategyParamResp struct{…}

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

Type Auto

Always auto.

type FileChunkingStrategyUnion interface{…}

The strategy used to chunk the file.

Accepts one of the following:
type StaticFileChunkingStrategyObject struct{…}
Type Static

Always static.

type OtherFileChunkingStrategyObject struct{…}

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.

Type Other

Always other.

type FileChunkingStrategyParamUnionResp interface{…}

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.

Accepts one of the following:
type AutoFileChunkingStrategyParamResp struct{…}

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

Type Auto

Always auto.

type StaticFileChunkingStrategyObjectParamResp struct{…}

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

Type Static

Always static.

type OtherFileChunkingStrategyObject struct{…}

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.

Type Other

Always other.

type StaticFileChunkingStrategy struct{…}
ChunkOverlapTokens int64

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.

MaxChunkSizeTokens int64

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
type StaticFileChunkingStrategyObject struct{…}
Type Static

Always static.

type StaticFileChunkingStrategyObjectParamResp struct{…}

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

Type Static

Always static.

type VectorStore struct{…}

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

ID string

The identifier, which can be referenced in API endpoints.

CreatedAt int64

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

FileCounts VectorStoreFileCounts
Cancelled int64

The number of files that were cancelled.

Completed int64

The number of files that have been successfully processed.

Failed int64

The number of files that have failed to process.

InProgress int64

The number of files that are currently being processed.

Total int64

The total number of files.

LastActiveAt int64

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

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.

Name string

The name of the vector store.

Object VectorStore

The object type, which is always vector_store.

Status VectorStoreStatus

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:
const VectorStoreStatusExpired VectorStoreStatus = "expired"
const VectorStoreStatusInProgress VectorStoreStatus = "in_progress"
const VectorStoreStatusCompleted VectorStoreStatus = "completed"
UsageBytes int64

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

ExpiresAfter VectorStoreExpiresAfteroptional

The expiration policy for a vector store.

Anchor LastActiveAt

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

Days int64

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

minimum1
maximum365
ExpiresAt int64optional

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

type VectorStoreDeleted struct{…}
ID string
Deleted bool
Object VectorStoreDeleted

Vector StoresFiles

List vector store files
client.VectorStores.Files.List(ctx, vectorStoreID, query) (*CursorPage[VectorStoreFile], error)
GET/vector_stores/{vector_store_id}/files
Create vector store file
client.VectorStores.Files.New(ctx, vectorStoreID, body) (*VectorStoreFile, error)
POST/vector_stores/{vector_store_id}/files
Update vector store file attributes
client.VectorStores.Files.Update(ctx, vectorStoreID, fileID, body) (*VectorStoreFile, error)
POST/vector_stores/{vector_store_id}/files/{file_id}
Retrieve vector store file
client.VectorStores.Files.Get(ctx, vectorStoreID, fileID) (*VectorStoreFile, error)
GET/vector_stores/{vector_store_id}/files/{file_id}
Delete vector store file
client.VectorStores.Files.Delete(ctx, vectorStoreID, fileID) (*VectorStoreFileDeleted, error)
DELETE/vector_stores/{vector_store_id}/files/{file_id}
Retrieve vector store file content
client.VectorStores.Files.Content(ctx, vectorStoreID, fileID) (*Page[VectorStoreFileContentResponse], error)
GET/vector_stores/{vector_store_id}/files/{file_id}/content
ModelsExpand Collapse
type VectorStoreFile struct{…}

A list of files attached to a vector store.

ID string

The identifier, which can be referenced in API endpoints.

CreatedAt int64

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

LastError VectorStoreFileLastError

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

Code string

One of server_error, unsupported_file, or invalid_file.

Accepts one of the following:
const VectorStoreFileLastErrorCodeServerError VectorStoreFileLastErrorCode = "server_error"
const VectorStoreFileLastErrorCodeUnsupportedFile VectorStoreFileLastErrorCode = "unsupported_file"
const VectorStoreFileLastErrorCodeInvalidFile VectorStoreFileLastErrorCode = "invalid_file"
Message string

A human-readable description of the error.

Object VectorStoreFile

The object type, which is always vector_store.file.

Status VectorStoreFileStatus

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:
const VectorStoreFileStatusInProgress VectorStoreFileStatus = "in_progress"
const VectorStoreFileStatusCompleted VectorStoreFileStatus = "completed"
const VectorStoreFileStatusCancelled VectorStoreFileStatus = "cancelled"
const VectorStoreFileStatusFailed VectorStoreFileStatus = "failed"
UsageBytes int64

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

VectorStoreID string

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

Attributes map[string, VectorStoreFileAttributeUnion]optional

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
float64
bool
ChunkingStrategy FileChunkingStrategyUnionoptional

The strategy used to chunk the file.

type VectorStoreFileDeleted struct{…}
ID string
Deleted bool
Object VectorStoreFileDeleted

Vector StoresFile Batches

Create vector store file batch
client.VectorStores.FileBatches.New(ctx, vectorStoreID, body) (*VectorStoreFileBatch, error)
POST/vector_stores/{vector_store_id}/file_batches
Retrieve vector store file batch
client.VectorStores.FileBatches.Get(ctx, vectorStoreID, batchID) (*VectorStoreFileBatch, error)
GET/vector_stores/{vector_store_id}/file_batches/{batch_id}
Cancel vector store file batch
client.VectorStores.FileBatches.Cancel(ctx, vectorStoreID, batchID) (*VectorStoreFileBatch, error)
POST/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel
List vector store files in a batch
client.VectorStores.FileBatches.ListFiles(ctx, vectorStoreID, batchID, query) (*CursorPage[VectorStoreFile], error)
GET/vector_stores/{vector_store_id}/file_batches/{batch_id}/files
ModelsExpand Collapse
type VectorStoreFileBatch struct{…}

A batch of files attached to a vector store.

ID string

The identifier, which can be referenced in API endpoints.

CreatedAt int64

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

FileCounts VectorStoreFileBatchFileCounts
Cancelled int64

The number of files that where cancelled.

Completed int64

The number of files that have been processed.

Failed int64

The number of files that have failed to process.

InProgress int64

The number of files that are currently being processed.

Total int64

The total number of files.

Object VectorStoreFilesBatch

The object type, which is always vector_store.file_batch.

Status VectorStoreFileBatchStatus

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

Accepts one of the following:
const VectorStoreFileBatchStatusInProgress VectorStoreFileBatchStatus = "in_progress"
const VectorStoreFileBatchStatusCompleted VectorStoreFileBatchStatus = "completed"
const VectorStoreFileBatchStatusCancelled VectorStoreFileBatchStatus = "cancelled"
const VectorStoreFileBatchStatusFailed VectorStoreFileBatchStatus = "failed"
VectorStoreID string

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