Create vector store
Create a vector store.
Request body
file_ids
array
A list of File IDs that the vector store should use. Useful for tools like
file_search
that can access files.items
string
name
string
The name of the vector store.expires_after
object
The expiration policy for a vector store.anchor
string
Required
Anchor timestamp after which the expiration policy applies. Supported anchors:
last_active_at
.last_active_at
string
days
integer
Required
The number of days after the anchor time that the vector store will expire.
chunking_strategy
object
The chunking strategy used to chunk the file(s). If not set, will use the
auto
strategy. Only applicable iffile_ids
is non-empty.Auto Chunking Strategy
object
The default strategy. This strategy currently uses a
max_chunk_size_tokens
of800
andchunk_overlap_tokens
of400
.type
string
Required
Always
auto
.auto
string
Static Chunking Strategy
object
Customize your own chunking strategy by setting chunk size and chunk overlap.type
string
Required
Always
static
.static
string
static
object
Required
max_chunk_size_tokens
integer
Required
The maximum number of tokens in each chunk. The default value is
800
. The minimum value is100
and the maximum value is4096
.chunk_overlap_tokens
integer
Required
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
.
metadata
object or null
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.
Response
A vector store object.
1 curl https://api.openai.com/v1/vector_stores \2 -H "Authorization: Bearer $OPENAI_API_KEY" \3 -H "Content-Type: application/json" \4 -H "OpenAI-Beta: assistants=v2" \5 -d '{6 "name": "Support FAQ"7 }'
1 {2 "id": "vs_abc123",3 "object": "vector_store",4 "created_at": 1699061776,5 "name": "Support FAQ",6 "bytes": 139920,7 "file_counts": {8 "in_progress": 0,9 "completed": 3,10 "failed": 0,11 "cancelled": 0,12 "total": 313 }14 }