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

client.beta.agents.vaults.list(VaultListParams { after, limit, metadata, 2 more } query?, RequestOptionsoptions?): CursorPage<Vault { id, created_at, metadata, 2 more } >
GET/vaults

Lists vaults using ID-based pagination. See vaults.

ParametersExpand Collapse
query: VaultListParams { after, limit, metadata, 2 more }
after?: string

Return resources after this resource ID in the selected order.

minLength0
maxLength1048576
limit?: number

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

formatint64
minimum1
maximum100
metadata?: Record<string, string>

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?: "asc" | "desc"

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

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

ReturnsExpand Collapse
Vault { id, created_at, metadata, 2 more }

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

id: string

The ID of the vault.

minLength0
created_at: number

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

formatint64
metadata: Record<string, string>

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

name: string | null

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

minLength0
object: "vault"

The object type. Always vault.

List vaults

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const vault of client.beta.agents.vaults.list()) {
  console.log(vault.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"
}