Implementation:Openai Openai python Vector Store List Params
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Python |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete tool for specifying pagination and ordering parameters when listing VectorStores via the OpenAI API, provided by the openai-python SDK.
Description
VectorStoreListParams is a TypedDict that defines the optional parameters for listing vector stores. It supports standard cursor-based pagination with after and before cursors, a limit on the number of returned objects (1 to 100, default 20), and an order field to sort by creation timestamp in ascending or descending order.
Usage
Import this type when you need to type-annotate keyword arguments for client.vector_stores.list() or when building parameter dictionaries for paginated listing of vector stores.
Code Reference
Source Location
- Repository: openai-python
- File: src/openai/types/vector_store_list_params.py
Signature
class VectorStoreListParams(TypedDict, total=False):
after: str
before: str
limit: int
order: Literal["asc", "desc"]
Import
from openai.types import VectorStoreListParams
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| after | str | No | A cursor object ID for forward pagination. Fetches the next page after this ID. |
| before | str | No | A cursor object ID for backward pagination. Fetches the previous page before this ID. |
| limit | int | No | A limit on the number of objects to return (1-100, default 20). |
| order | Literal["asc", "desc"] | No | Sort order by created_at timestamp. "asc" for ascending, "desc" for descending. |
Usage Examples
from openai import OpenAI
from openai.types import VectorStoreListParams
client = OpenAI()
# List vector stores with pagination
params: VectorStoreListParams = {
"limit": 50,
"order": "desc",
}
page = client.vector_stores.list(**params)
for vs in page.data:
print(vs.id, vs.name)