Create vector store file batch
vector_stores.file_batches.create(strvector_store_id, FileBatchCreateParams**kwargs) -> VectorStoreFileBatch
POST/vector_stores/{vector_store_id}/file_batches
Create a vector store file batch.
Parameters
A list of File IDs that the vector store should use. Useful for tools like file_search that can access files. If attributes or chunking_strategy are provided, they will be applied to all files in the batch. The maximum batch size is 2000 files. This endpoint is recommended for multi-file ingestion and helps reduce per-vector-store write request pressure. Mutually exclusive with files.
Create vector store file batch
from openai import OpenAI
client = OpenAI()
vector_store_file_batch = client.vector_stores.file_batches.create(
vector_store_id="vs_abc123",
files=[
{
"file_id": "file-abc123",
"attributes": {"category": "finance"},
},
{
"file_id": "file-abc456",
"chunking_strategy": {
"type": "static",
"max_chunk_size_tokens": 1200,
"chunk_overlap_tokens": 200,
},
},
],
)
print(vector_store_file_batch)
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "in_progress",
"file_counts": {
"in_progress": 1,
"completed": 1,
"failed": 0,
"cancelled": 0,
"total": 0,
}
}
Returns Examples
{
"id": "vsfb_abc123",
"object": "vector_store.file_batch",
"created_at": 1699061776,
"vector_store_id": "vs_abc123",
"status": "in_progress",
"file_counts": {
"in_progress": 1,
"completed": 1,
"failed": 0,
"cancelled": 0,
"total": 0,
}
}