Vector Store Files API

Vector store files are files that you can attach to a vector store.

Note

The OCI Vector Store Files APII uses the same format as the OpenAI Vector Store Files API with the OCI OpenAI-compatible endpoint. For syntax and request details, see the OpenAI Vector Store Files API documentation.

Supported API Endpoint

Base URL Endpoint Path Authentication
https://inference.generativeai.${region}.oci.oraclecloud.com/openai/v1 /vector_stores/{id}/files API key or IAM session

Replace ${region} with a supported OCI region such as us-chicago-1.

Although the request format is OpenAI-compatible, authentication uses OCI credentials, requests are routed through OCI Generative AI inference endpoints, and resources and execution remain in OCI.

Tip

For steps to perform before using this API, see the QuickStart.

Creating a Vector Store File

POST /vector_stores/{vector_store_id}/files

Reference

Create vector store file

Example:

# create vector store file

vector_store_file = client.vector_stores.files.create(
  vector_store_id="xxx",
  file_id="xxx"
)
print(vector_store_file)

Listing Vector Store Files

GET /vector_stores/{vector_store_id}/files

Reference

List vector store files

Example:

# list vector store files

vector_store_files = client.vector_stores.files.list(
  vector_store_id="xxx"
)
print(vector_store_files)

Retrieving Vector Store File Information

GET /vector_stores/{vector_store_id}/files/{file_id}

Reference

Retrieve vector store file

Example:

# retrieve vector store file

vector_store_file = client.vector_stores.files.retrieve(
  vector_store_id="xxx",
  file_id="xxx"
)
print(vector_store_file)

Deleting a Vector Store File

DELETE /vector_stores/{vector_store_id}/files/{file_id}

Reference

Delete vector store file

Example:

# delete a vector store file

deleted_vector_store_file = client.vector_stores.files.delete(
    vector_store_id="xxx",
    file_id="xxx"
)
print(deleted_vector_store_file)