POST
/vector_stores/{vector_store_id}/filesCreate a vector store file
Creates a vector store file by attaching an existing File to a vector store. Supply file_id and optionally configure chunking_strategy or attach up to 16 attribute pairs. The returned file may remain in progress while ingestion completes.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
vector_store_idstringrequired
The identifier of the vector store to attach the File to.
Vector store file attachment details. file_id is required; chunking and attributes are optional.
file_idstringrequired
A [File](https://developers.openai.com/api/reference/resources/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. For multi-file ingestion, we recommend [`file_batches`](https://developers.openai.com/api/reference/resources/vector_stores/subresources/file_batches/methods/create) to minimize per-vector-store write requests.
chunking_strategyobjectoptional
The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy.
attributesobjectoptional
Up to 16 key-value pairs to associate with the vector store file, or null.
200Returns the created vector store file with its identifier, vector store association, ingestion status, usage in bytes, chunking strategy, and attributes.
idstringrequired
The identifier, which can be referenced in API endpoints.
objectstringrequired
The object type, which is always `vector_store.file`.
usage_bytesintegerrequired
The total vector store usage in bytes. Note that this may be different from the original file size.
created_atintegerrequired
The Unix timestamp (in seconds) for when the vector store file was created.
vector_store_idstringrequired
The ID of the [vector store](https://developers.openai.com/api/reference/resources/vector_stores) that the [File](https://developers.openai.com/api/reference/resources/files) is attached to.
statusstringrequired
The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use.
last_errorobjectrequired
The last error associated with this vector store file. Will be `null` if there are no errors.
chunking_strategyobjectoptional
The strategy used to chunk the file.
attributesobjectoptional
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, booleans, or numbers.
429Returned when the request was rejected because a rate limit was exceeded.
errorobjectrequired
Error handling
file_id is required and must identify the File to attach. chunking_strategy must use either the automatic or static strategy, and attributes may contain no more than 16 key-value pairs. A 429 is returned when the request exceeds the rate limit.