Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Retrieve vector store file content

vector_stores.files.content(file_id, **kwargs) -> SyncPage[FileContentResponse]
GET
/vector_stores/{vector_store_id}/files/{file_id}/content

Retrieve the parsed contents of a vector store file.

Parameters
vector_store_id: str
file_id: str
Returns
class FileContentResponse: …
text: Optional[str]

The text content

type: Optional[str]

The content type (currently only "text")

Retrieve vector store file content

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("OPENAI_API_KEY"),  # This is the default and can be omitted
)
page = client.vector_stores.files.content(
    file_id="file-abc123",
    vector_store_id="vs_abc123",
)
page = page.data[0]
print(page.text)
Response example
{
  "object": "vector_store.file_content.page",
  "data": [
    {"type": "text", "text": "file content"}
  ],
  "has_more": false,
  "next_page": null
}
Returns Examples
Response example
{
  "object": "vector_store.file_content.page",
  "data": [
    {"type": "text", "text": "file content"}
  ],
  "has_more": false,
  "next_page": null
}