Body Required
-
file_ids array[string]
A list of File IDs that the vector store should use. Useful for tools like
file_search
that can access files.Not more than
500
elements. -
name string
The name of the vector store.
-
expires_after object
The expiration policy for a vector store.
-
metadata object | 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. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
POST
/vector_stores
curl \
-X POST https://api.openai.com/v1/vector_stores \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"file_ids":["string"],"name":"string","expires_after":{"anchor":"last_active_at","days":42},"chunking_strategy":{"type":"auto"},"metadata":{}}'
Request example
{
"file_ids": [
"string"
],
"name": "string",
"expires_after": {
"anchor": "last_active_at",
"days": 42
},
"chunking_strategy": {
"type": "auto"
},
"metadata": {}
}
Response examples (200)
{
"id": "string",
"object": "vector_store",
"created_at": 42,
"name": "string",
"usage_bytes": 42,
"file_counts": {
"in_progress": 42,
"completed": 42,
"failed": 42,
"cancelled": 42,
"total": 42
},
"status": "expired",
"expires_after": {
"anchor": "last_active_at",
"days": 42
},
"expires_at": 42,
"last_active_at": 42,
"metadata": {}
}