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

Retrieve a vault

Vault beta().agents().vaults().retrieve(VaultRetrieveParamsparams = VaultRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/vaults/{vault_id}

Retrieves a vault by its ID. See vaults.

ParametersExpand Collapse
VaultRetrieveParams params
Optional<String> vaultId
minLength0
maxLength1048576
ReturnsExpand Collapse
class Vault:

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

String id

The ID of the vault.

minLength0
long createdAt

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

formatint64
Metadata metadata

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

Optional<String> name

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

minLength0
JsonValue; object_ "vault"constant"vault"constant

The object type. Always vault.

Retrieve a vault

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.beta.agents.vaults.Vault;
import com.openai.models.beta.agents.vaults.VaultRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        Vault vault = client.beta().agents().vaults().retrieve("vault_id");
    }
}
{
  "id": "id",
  "created_at": 0,
  "metadata": {
    "foo": "string"
  },
  "name": "name",
  "object": "vault"
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "metadata": {
    "foo": "string"
  },
  "name": "name",
  "object": "vault"
}