Llm.VectorStores
Overview
Available Operations
- create - Create a vector store
- list - List vector stores
- get - Retrieve a vector store
- update - Modify a vector store
- delete - Delete a vector store
- search - Search a vector store
- createFile - Add a file to a vector store
- listFiles - List files in a vector store
- getFile - Retrieve a vector store file
- updateFile - Update file attributes
- deleteFile - Remove file from vector store
- getFileContent - Retrieve parsed file content
- createFileBatch - Batch add multiple files to vector store
- getFileBatch - Retrieve file batch status
- cancelFileBatch - Cancel batch file processing
- listFilesInBatch - List files in a batch
create
Create a new vector store for storing and searching through document embeddings. Vector stores enable semantic search capabilities and power the file_search tool in the Responses and Assistants APIs. Optionally provide a name and description for organization, specify file IDs to pre-populate the store, configure chunking strategy (auto or custom static chunking), set expiration policies, and attach metadata. Files are automatically chunked and embedded for semantic search. Returns the created vector store object with status indicating processing progress. Use this to build knowledge bases, document search systems, RAG (Retrieval Augmented Generation) applications, and AI assistants with access to custom data sources.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.create({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCreate } from "@meetkai/mka1/funcs/llmVectorStoresCreate.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCreate(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCreate failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCreateMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCreate.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | components.CreateVectorStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStore>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
list
Retrieve a paginated list of all vector stores in the organization, ordered by creation date. Each vector store includes its ID, name, status (expired, in_progress, completed), file counts, usage statistics, and metadata. Supports cursor-based pagination using 'after' and 'before' parameters, customizable page size with 'limit' (1-100, default 20), and sort order with 'order' (asc or desc). Returns a list object containing the vector stores array, pagination cursors (first_id, last_id, has_more), and enables efficient navigation through large collections. Useful for building vector store management dashboards, listing available knowledge bases, monitoring processing status, and organizing document collections.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.list({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresList } from "@meetkai/mka1/funcs/llmVectorStoresList.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresList(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresList failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresList,
useLlmVectorStoresListSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresList,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresList,
invalidateAllLlmVectorStoresList,
} from "@meetkai/mka1/react-query/llmVectorStoresList.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListVectorStoresRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
get
Retrieve detailed information about a specific vector store using its unique ID. Returns complete details including the store's name and description, current status (expired, in_progress, completed indicating readiness), file processing counts showing how many files are completed, in progress, failed, or cancelled, total storage usage in bytes, creation and last active timestamps, expiration policy and timestamp if configured, and any attached metadata key-value pairs. Essential for checking if a vector store is ready for search operations, monitoring file processing progress, tracking storage usage, and retrieving configuration details. Returns 404 if the vector store ID doesn't exist.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.get({
vectorStoreId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGet } from "@meetkai/mka1/funcs/llmVectorStoresGet.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGet(sdk, {
vectorStoreId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGet failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGet,
useLlmVectorStoresGetSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGet,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGet,
invalidateAllLlmVectorStoresGet,
} from "@meetkai/mka1/react-query/llmVectorStoresGet.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetVectorStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStore>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
update
Update the properties of an existing vector store. Modify the store's name for better organization, update or remove the expiration policy to control automatic cleanup (set to null to disable expiration), and update metadata key-value pairs for custom tracking and categorization. Note that you cannot modify the files or chunking strategy after creation - use the files endpoints to add or remove files instead. Returns the updated vector store object with all current properties. Useful for renaming knowledge bases, adjusting retention policies, updating organizational metadata, and maintaining vector store configurations. Returns 404 if the vector store ID doesn't exist.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.update({
vectorStoreId: "<id>",
modifyVectorStoreRequest: {},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresUpdate } from "@meetkai/mka1/funcs/llmVectorStoresUpdate.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresUpdate(sdk, {
vectorStoreId: "<id>",
modifyVectorStoreRequest: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresUpdate failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresUpdateMutation
} from "@meetkai/mka1/react-query/llmVectorStoresUpdate.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ModifyVectorStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStore>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
delete
Permanently delete a vector store and all associated embeddings and search indexes. This operation removes the vector store container but does NOT delete the original files - files remain accessible and can be reused in other vector stores. Once deleted, the vector store cannot be recovered and all semantic search capabilities for this collection are lost. Any Responses or Assistants currently using this vector store will fail when attempting file_search operations. Returns a deletion confirmation object with the store ID and deleted status. Use this to clean up unused knowledge bases, remove outdated document collections, manage storage costs, or comply with data retention policies. Returns 404 if the vector store ID doesn't exist or has already been deleted.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.delete({
vectorStoreId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresDelete } from "@meetkai/mka1/funcs/llmVectorStoresDelete.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresDelete(sdk, {
vectorStoreId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresDelete failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresDeleteMutation
} from "@meetkai/mka1/react-query/llmVectorStoresDelete.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteVectorStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreDeletionStatus>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
search
Perform semantic search within a vector store to find the most relevant document chunks for a given query. Provide a natural language query string (or array of queries for multi-query search), optionally filter results by file attributes using comparison or compound filters (eq, ne, gt, lt, in, nin operators with and/or logic), set max_num_results to control how many results to return (1-50, default 10), configure ranking options to enable/disable re-ranking and set score thresholds for relevance filtering, and enable query rewriting to optimize search performance. Returns a page of search results with each result containing the matched text content, relevance score, file ID and filename, and any file attributes. Results are ranked by semantic similarity using embeddings. Essential for building RAG applications, semantic document search, question-answering systems, and knowledge retrieval workflows. Returns 404 if the vector store doesn't exist.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.search({
vectorStoreId: "<id>",
searchVectorStoreRequest: {
query: [],
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresSearch } from "@meetkai/mka1/funcs/llmVectorStoresSearch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresSearch(sdk, {
vectorStoreId: "<id>",
searchVectorStoreRequest: {
query: [],
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresSearch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresSearchMutation
} from "@meetkai/mka1/react-query/llmVectorStoresSearch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.SearchVectorStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreSearchResults>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
createFile
Add a single file to an existing vector store for semantic search indexing. Provide a file_id from a previously uploaded file (use the Files API to upload), optionally specify attributes as key-value pairs for metadata filtering during search (supports strings, numbers, and booleans up to 16 pairs), and configure the chunking strategy (auto with 800 token chunks and 400 token overlap, or custom static chunking with your own parameters). The file is asynchronously processed - it's parsed, split into chunks according to the strategy, embedded using OpenAI's embedding models, and indexed for vector search. Returns a vector store file object with status indicating processing state (in_progress, completed, failed, cancelled). Monitor the status to know when the file is ready for search. Use this to incrementally add documents to knowledge bases, build document collections, and maintain searchable content libraries.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.createFile({
vectorStoreId: "<id>",
createVectorStoreFileRequest: {
fileId: "<id>",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCreateFile } from "@meetkai/mka1/funcs/llmVectorStoresCreateFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCreateFile(sdk, {
vectorStoreId: "<id>",
createVectorStoreFileRequest: {
fileId: "<id>",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCreateFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCreateFileMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCreateFile.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateVectorStoreFileRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFile>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listFiles
Retrieve a paginated list of all files in a specific vector store, ordered by creation date. Each file entry includes its ID, processing status (in_progress, completed, failed, cancelled), usage statistics in bytes, creation timestamp, chunking strategy used, attributes, and any error information if processing failed. Supports filtering by status to find files in specific states, cursor-based pagination with 'after' and 'before' parameters, customizable page size with 'limit' (1-100, default 20), and sort order with 'order' (asc or desc). Returns a list object with the files array and pagination cursors. Essential for monitoring file processing progress, auditing vector store contents, troubleshooting failed uploads, and managing document collections within knowledge bases.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.listFiles({
vectorStoreId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresListFiles } from "@meetkai/mka1/funcs/llmVectorStoresListFiles.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresListFiles(sdk, {
vectorStoreId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresListFiles failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresListFiles,
useLlmVectorStoresListFilesSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresListFiles,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresListFiles,
invalidateAllLlmVectorStoresListFiles,
} from "@meetkai/mka1/react-query/llmVectorStoresListFiles.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListVectorStoreFilesRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFileList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getFile
Retrieve detailed information about a specific file within a vector store. Returns complete details including the file's unique ID, current processing status (in_progress, completed, failed, cancelled indicating whether it's ready for search), the vector store ID it belongs to, creation timestamp, storage usage in bytes (may differ from original file size due to chunking and indexing), the chunking strategy that was applied (auto, static, or other for legacy files), any attached attributes used for filtering, and detailed error information if processing failed (including error codes like server_error, unsupported_file, or invalid_file with human-readable messages). Essential for checking if a specific file is ready for search, debugging processing failures, and retrieving file configuration details. Returns 404 if the file ID doesn't exist in the specified vector store.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.getFile({
vectorStoreId: "<id>",
fileId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGetFile } from "@meetkai/mka1/funcs/llmVectorStoresGetFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGetFile(sdk, {
vectorStoreId: "<id>",
fileId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGetFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGetFile,
useLlmVectorStoresGetFileSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGetFile,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGetFile,
invalidateAllLlmVectorStoresGetFile,
} from "@meetkai/mka1/react-query/llmVectorStoresGetFile.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetVectorStoreFileRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFile>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
updateFile
Update the metadata attributes attached to a file within a vector store. Attributes are key-value pairs (up to 16 pairs, keys max 64 chars, values max 512 chars or numbers/booleans) that can be used for filtering during vector store search operations. This allows you to categorize and tag files with custom metadata like document type, author, date, department, sensitivity level, version, or any domain-specific classifications. These attributes enable filtered semantic search - for example, searching only within files from a specific department or date range. Completely replaces existing attributes with the new set provided. Returns the updated vector store file object. Essential for maintaining organized document collections, enabling filtered search capabilities, and keeping file metadata current. Returns 404 if the file doesn't exist.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.updateFile({
vectorStoreId: "<id>",
fileId: "<id>",
updateVectorStoreFileAttributesRequest: {
attributes: {
"key": true,
},
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresUpdateFile } from "@meetkai/mka1/funcs/llmVectorStoresUpdateFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresUpdateFile(sdk, {
vectorStoreId: "<id>",
fileId: "<id>",
updateVectorStoreFileAttributesRequest: {
attributes: {
"key": true,
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresUpdateFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresUpdateFileMutation
} from "@meetkai/mka1/react-query/llmVectorStoresUpdateFile.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.UpdateVectorStoreFileAttributesRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFile>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
deleteFile
Remove a file from a vector store, deleting all associated chunks, embeddings, and search indexes for that file. This operation removes the file from the vector store but does NOT delete the original file itself - the file remains accessible via the Files API and can be added to other vector stores or used elsewhere. Once removed, the file's content will no longer appear in search results for this vector store. Useful for removing outdated documents, cleaning up incorrect uploads, managing vector store contents, reducing storage costs, or refreshing document versions (remove old, add new). Returns a deletion confirmation object. Returns 404 if the file doesn't exist in the specified vector store. Cannot be undone - if you need the file searchable again, you must re-add it which triggers reprocessing.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.deleteFile({
vectorStoreId: "<id>",
fileId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresDeleteFile } from "@meetkai/mka1/funcs/llmVectorStoresDeleteFile.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresDeleteFile(sdk, {
vectorStoreId: "<id>",
fileId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresDeleteFile failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresDeleteFileMutation
} from "@meetkai/mka1/react-query/llmVectorStoresDeleteFile.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteVectorStoreFileRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFileDeletionStatus>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getFileContent
Retrieve the complete parsed and processed contents of a file within a vector store. Returns the original filename, file ID, any attached attributes, and an array of content items representing the parsed text extracted from the file. Each content item contains the extracted text in a structured format. This endpoint provides access to how the file was interpreted and processed before chunking and embedding. Useful for verifying correct file parsing, debugging search results by inspecting the source text, reviewing extracted content quality, auditing what text was actually indexed, and understanding how documents are represented in the vector store. Returns 404 if the file doesn't exist. Only works for completed files - files still in progress or that failed won't have content available.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.getFileContent({
vectorStoreId: "<id>",
fileId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGetFileContent } from "@meetkai/mka1/funcs/llmVectorStoresGetFileContent.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGetFileContent(sdk, {
vectorStoreId: "<id>",
fileId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGetFileContent failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGetFileContent,
useLlmVectorStoresGetFileContentSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGetFileContent,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGetFileContent,
invalidateAllLlmVectorStoresGetFileContent,
} from "@meetkai/mka1/react-query/llmVectorStoresGetFileContent.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetVectorStoreFileContentRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFileContent>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
createFileBatch
Efficiently add multiple files to a vector store in a single batch operation. Provide either a simple array of file IDs with shared attributes/chunking strategy, or a detailed array of file objects where each file can have its own attributes and chunking configuration. Global attributes and chunking strategy (if provided) apply to all files when using the simple file_ids array. When using the detailed files array, each file's individual settings override any global settings. Files are processed asynchronously and in parallel for performance. Returns a file batch object with an ID, status (in_progress, completed, cancelled, failed), and file_counts showing processing progress. Monitor the batch status or individual file statuses to track completion. Essential for bulk knowledge base creation, migrating document collections, initial vector store population, and efficiently managing large document sets.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.createFileBatch({
vectorStoreId: "<id>",
createVectorStoreFileBatchRequest: {},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCreateFileBatch } from "@meetkai/mka1/funcs/llmVectorStoresCreateFileBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCreateFileBatch(sdk, {
vectorStoreId: "<id>",
createVectorStoreFileBatchRequest: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCreateFileBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCreateFileBatchMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCreateFileBatch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateVectorStoreFileBatchRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFileBatch>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getFileBatch
Retrieve detailed status information about a specific file batch operation within a vector store. Returns the batch ID, object type (always 'vector_store.file_batch'), creation timestamp, the vector store ID it belongs to, current processing status (in_progress, completed, cancelled, or failed), and detailed file_counts breakdown showing how many files are in_progress, completed, failed, cancelled, and the total count. Use this to monitor bulk file upload progress, check if a batch has finished processing, identify how many files succeeded or failed, and determine when the vector store is ready for search with the newly added documents. Essential for tracking asynchronous batch operations and building progress indicators. Returns 404 if the batch ID doesn't exist.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.getFileBatch({
vectorStoreId: "<id>",
batchId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresGetFileBatch } from "@meetkai/mka1/funcs/llmVectorStoresGetFileBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresGetFileBatch(sdk, {
vectorStoreId: "<id>",
batchId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresGetFileBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresGetFileBatch,
useLlmVectorStoresGetFileBatchSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresGetFileBatch,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresGetFileBatch,
invalidateAllLlmVectorStoresGetFileBatch,
} from "@meetkai/mka1/react-query/llmVectorStoresGetFileBatch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetVectorStoreFileBatchRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFileBatch>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
cancelFileBatch
Cancel an in-progress file batch operation, attempting to stop the processing of files as soon as possible. Files that have already completed processing remain in the vector store and are searchable. Files currently being processed may or may not complete depending on their processing stage. Files that haven't started processing will be cancelled and won't be added to the vector store. The batch status is updated to reflect the cancellation, and file_counts show how many files were completed before cancellation vs. how many were cancelled. Useful for stopping accidental batch uploads, managing resource usage, enforcing timeouts, or abandoning batches when errors are detected. Returns the updated file batch object with current status and counts. Returns 404 if the batch doesn't exist. Has no effect if the batch has already completed or failed.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.cancelFileBatch({
vectorStoreId: "<id>",
batchId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresCancelFileBatch } from "@meetkai/mka1/funcs/llmVectorStoresCancelFileBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresCancelFileBatch(sdk, {
vectorStoreId: "<id>",
batchId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresCancelFileBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useLlmVectorStoresCancelFileBatchMutation
} from "@meetkai/mka1/react-query/llmVectorStoresCancelFileBatch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CancelVectorStoreFileBatchRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFileBatch>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listFilesInBatch
Retrieve a paginated list of all files within a specific batch operation, showing the status and details of each file in the batch. Each file entry includes its ID, processing status, creation timestamp, and the vector store ID. Supports filtering by file status to find files in specific states (in_progress, completed, failed, cancelled), cursor-based pagination with 'after' and 'before' parameters, customizable page size with 'limit' (1-100, default 20), and sort order with 'order' (asc or desc). Returns a list object with the files array and pagination cursors. Essential for monitoring which specific files in a batch succeeded or failed, debugging batch processing issues, identifying problematic files, and tracking granular progress of bulk uploads. Use this to build detailed batch progress indicators and troubleshoot failed file processing.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.llm.vectorStores.listFilesInBatch({
vectorStoreId: "<id>",
batchId: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { llmVectorStoresListFilesInBatch } from "@meetkai/mka1/funcs/llmVectorStoresListFilesInBatch.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
serverURL: "https://api.example.com",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await llmVectorStoresListFilesInBatch(sdk, {
vectorStoreId: "<id>",
batchId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("llmVectorStoresListFilesInBatch failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useLlmVectorStoresListFilesInBatch,
useLlmVectorStoresListFilesInBatchSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchLlmVectorStoresListFilesInBatch,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateLlmVectorStoresListFilesInBatch,
invalidateAllLlmVectorStoresListFilesInBatch,
} from "@meetkai/mka1/react-query/llmVectorStoresListFilesInBatch.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListVectorStoreFilesInBatchRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.VectorStoreFileList>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |