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

List vaults

beta.agents.vaults.list(VaultListParams**kwargs) -> SyncCursorPage[Vault]
GET/vaults

Lists vaults using ID-based pagination. See vaults.

ParametersExpand Collapse
after: Optional[str]

Return resources after this resource ID in the selected order.

minLength0
maxLength1048576
limit: Optional[int]

The maximum number of resources to return, between 1 and 100. Defaults to 20.

formatint64
minimum1
maximum100
metadata: Optional[Dict[str, str]]

Exact string matches supplied as metadata[key]=value. All supplied pairs must match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512 characters. Filtering is eventually consistent; metadata changes may take time to appear.

order: Optional[Literal["asc", "desc"]]

The order in which resources are returned. Defaults to desc.

status: Optional[VaultStatusFilterParam]

Filter by one status or a list, such as status=active or status[]=active&status[]=archived. Both statuses are included by default.

ReturnsExpand Collapse
class Vault: …

A collection of credentials for MCP servers and OpenAI-hosted environments.

id: str

The ID of the vault.

minLength0
created_at: int

The Unix timestamp, in seconds, when the vault was created.

formatint64
metadata: Dict[str, str]

Key-value pairs associated with the vault, such as an application or team identifier.

name: Optional[str]

The human-readable name of the vault, if set.

minLength0
object: Literal["vault"]

The object type. Always vault.

List vaults

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.beta.agents.vaults.list()
page = page.data[0]
print(page.id)
{
  "data": [
    {
      "id": "id",
      "created_at": 0,
      "metadata": {
        "foo": "string"
      },
      "name": "name",
      "object": "vault"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}
Returns Examples
{
  "data": [
    {
      "id": "id",
      "created_at": 0,
      "metadata": {
        "foo": "string"
      },
      "name": "name",
      "object": "vault"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id",
  "object": "list"
}