List vector stores

GET /vector_stores

Returns a list of vector stores.

Query parameters

  • limit integer

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

    Default value is 20.

  • order string

    Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

    Values are asc or desc. Default value is desc.

  • after string

    A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • before string

    A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • object string Required
    • data array[object] Required

      A vector store is a collection of processed files can be used by the file_search tool.

      Hide data attributes Show data attributes object
      • id string Required

        The identifier, which can be referenced in API endpoints.

      • object string Required

        The object type, which is always vector_store.

        Value is vector_store.

      • created_at integer Required

        The Unix timestamp (in seconds) for when the vector store was created.

      • name string Required

        The name of the vector store.

      • usage_bytes integer Required

        The total number of bytes used by the files in the vector store.

      • file_counts object Required
        Hide file_counts attributes Show file_counts attributes object
        • in_progress integer Required

          The number of files that are currently being processed.

        • completed integer Required

          The number of files that have been successfully processed.

        • failed integer Required

          The number of files that have failed to process.

        • cancelled integer Required

          The number of files that were cancelled.

        • total integer Required

          The total number of files.

      • status string Required

        The status of the vector store, which can be either expired, in_progress, or completed. A status of completed indicates that the vector store is ready for use.

        Values are expired, in_progress, or completed.

      • The expiration policy for a vector store.

        Hide expires_after attributes Show expires_after attributes object
        • anchor string Required

          Anchor timestamp after which the expiration policy applies. Supported anchors: last_active_at.

          Value is last_active_at.

        • days integer Required

          The number of days after the anchor time that the vector store will expire.

          Minimum value is 1, maximum value is 365.

      • expires_at integer | null

        The Unix timestamp (in seconds) for when the vector store will expire.

      • last_active_at integer | null Required

        The Unix timestamp (in seconds) for when the vector store was last active.

      • metadata object | null Required

        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. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.

    • first_id string Required
    • last_id string Required
    • has_more boolean Required
GET /vector_stores
curl \
 -X GET https://api.openai.com/v1/vector_stores \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "object": "list",
  "data": [
    {
      "id": "string",
      "object": "vector_store",
      "created_at": 42,
      "name": "string",
      "usage_bytes": 42,
      "file_counts": {
        "in_progress": 42,
        "completed": 42,
        "failed": 42,
        "cancelled": 42,
        "total": 42
      },
      "status": "expired",
      "expires_after": {
        "anchor": "last_active_at",
        "days": 42
      },
      "expires_at": 42,
      "last_active_at": 42,
      "metadata": {}
    }
  ],
  "first_id": "vs_abc123",
  "last_id": "vs_abc456",
  "has_more": false
}