Skip to main content

/vector_stores/{vector_store_id}/files

Vector store files represent the individual files that live inside a vector store.

FeatureSupported
Loggingβœ… (full request/response logging)
Supported Providersopenai

Supported operations​

OperationDescriptionOpenAI Python ClientLiteLLM Proxy
Create vector store fileAttach a file to a vector store with optional chunking overridesβœ…βœ…
List vector store filesPaginated listing with filtersβœ…βœ…
Retrieve vector store fileFetch metadata for a single fileβœ…βœ…
Delete vector store fileRemove a file from a store (file object persists)βœ…βœ…
Retrieve vector store file contentStream processed chunksβŒβœ…
Update vector store file attributesPatch custom attributesβŒβœ…
note

Vector store support currently works only with OpenAI vector stores and OpenAI-uploaded file IDs.

Create vector store file​

POST http://localhost:4000/v1/vector_stores/{vector_store_id}/files
from openai import OpenAI

client = OpenAI(
base_url="http://localhost:4000", # LiteLLM proxy or OpenAI base
api_key="sk-1234"
)

vector_store_file = client.vector_stores.files.create(
vector_store_id="vs_69172088a18c8191ab3e2621aa87d1ee",
file_id="file-NDbEDJTfqVh7S4Ugi3CGYw",
chunking_strategy={
"type": "static",
"static": {
"max_chunk_size_tokens": 800,
"chunk_overlap_tokens": 400,
},
},
)

print(vector_store_file)

List vector store files​

GET http://localhost:4000/v1/vector_stores/{vector_store_id}/files

Parameters:

  • vector_store_id (path, required)
  • after / before (query, optional) – pagination cursors
  • filter (query, optional) – in_progress, completed, failed, cancelled
  • limit (query, optional, default 20, range 1-100)
  • order (query, optional, default desc)
vector_store_files = client.vector_stores.files.list(
vector_store_id="vs_abc123"
)
print(vector_store_files)

Retrieve vector store file​

GET http://localhost:4000/v1/vector_stores/{vector_store_id}/files/{file_id}
vector_store_file = client.vector_stores.files.retrieve(
vector_store_id="vs_abc123",
file_id="file-abc123"
)
print(vector_store_file)

Delete vector store file​

DELETE http://localhost:4000/v1/vector_stores/{vector_store_id}/files/{file_id}
deleted_vector_store_file = client.vector_stores.files.delete(
vector_store_id="vs_abc123",
file_id="file-abc123"
)
print(deleted_vector_store_file)

Proxy-only endpoints​

When you need raw content chunks or attribute updates, call the LiteLLM Proxy directly.

Retrieve file content​

curl -X GET "http://localhost:4000/v1/vector_stores/\{vector_store_id\}/files/\{file_id\}/content" \
-H "Authorization: Bearer sk-1234"

Update file attributes​

curl -X POST "http://localhost:4000/v1/vector_stores/\{vector_store_id\}/files/\{file_id\}" \
-H "Authorization: Bearer sk-1234" \
-H "Content-Type: application/json" \
-d '{
"attributes": {
"category": "support-faq",
"language": "en"
}
}'