Batch add multiple files to vector store
Adds multiple files to a vector store in a single batch operation. A file with the same content as one the store already holds, or as an earlier file in the batch, fails the batch with 409 unless skip_duplicates is set, in which case it is recorded as cancelled with duplicate_file and the rest are attached. Returns 410 once the vector store has expired.
Authorizations
Send Authorization: Bearer , using an MKA1 API key for automation or an OAuth API access token for a signed-in application. Use a dynamic security callback to refresh OAuth access tokens. Browser session-only operations still require their declared cookie.
Headers
Optional external end-user identifier forwarded by the API gateway.
Path Parameters
The ID of the vector store for which to create a File Batch.
Body
Request body for creating a vector store file batch.
A list of File IDs that the vector store should use. If attributes or chunking_strategy are provided at the root level, they will be applied to all files in the batch. Mutually exclusive with 'files'. At most 500 per batch.
500A list of objects that each include a file_id plus optional attributes or chunking_strategy. Use this when you need to override metadata for specific files. Entries without their own attributes or chunking_strategy fall back to the request-level values. Mutually exclusive with 'file_ids'. At most 500 per batch.
500Batch-wide default attributes, applied to every file that does not carry its own (a 'files' entry's attributes override this). Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 1024 characters, booleans, or numbers. The string limit is higher than the OpenAI API's 512. At most 16 key-value pairs; the gateway's own 'filename' and 'purpose' keys, which the file object returns, are not counted.
Batch-wide default chunking strategy, applied to every file that does not carry its own (a 'files' entry's chunking_strategy overrides this).
- Option 1
- Option 2
When a file has the same content (SHA-256) as a file the store already holds, or as an earlier file in this batch, skip it instead of refusing the batch. A skipped file gets a cancelled row whose last_error is duplicate_file and names the file that holds the content. Default false: a duplicate fails the whole batch with 409 and nothing is attached.
Response
OK
A batch of files attached to a vector store.
The identifier, which can be referenced in API endpoints.
The object type, which is always 'vector_store.file_batch'.
The Unix timestamp (in seconds) for when the vector store files batch was created.
-9007199254740991 <= x <= 9007199254740991The ID of the vector store that the File is attached to.
The status of the vector store files batch. 'in_progress' means files are being processed, 'completed' means all files have been processed, 'cancelled' means the batch was cancelled, 'failed' means the batch failed.
in_progress, completed, cancelled, failed File processing status counts.