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(ctx, query) (*CursorPage[Vault], error)
GET/vaults

Lists vaults using ID-based pagination. See vaults.

ParametersExpand Collapse
query BetaAgentVaultListParams
After param.Field[string]Optional

Return resources after this resource ID in the selected order.

minLength0
maxLength1048576
Limit param.Field[int64]Optional

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

formatint64
minimum1
maximum100
Metadata param.Field[map[string, string]]Optional

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 param.Field[BetaAgentVaultListParamsOrder]Optional

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

Status param.Field[VaultStatusFilterUnion]Optional

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

ReturnsExpand Collapse
type Vault struct{…}

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

ID string

The ID of the vault.

minLength0
CreatedAt int64

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

formatint64
Metadata map[string, string]

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

Name string

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

minLength0
Object Vault

The object type. Always vault.

List vaults

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.Beta.Agents.Vaults.List(context.TODO(), openai.BetaAgentVaultListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "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"
}