## Retrieve a vault

`client.beta.agents.vaults.retrieve(stringvaultID, RequestOptionsoptions?): Vault`

**get** `/vaults/{vault_id}`

Retrieves a vault by its ID. See [vaults](/api/docs/guides/agents-api/tools/vaults).

### Parameters

- `vaultID: string`

  `minLength: 0`, `maxLength: 1048576`

### Returns

- `Vault`

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

  - `id: string`

    The ID of the vault.

    `minLength: 0`

  - `created_at: number`

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

    `format: int64`

  - `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.

    `minLength: 0`

  - `object: "vault"`

    The object type. Always `vault`.

    - `"vault"`

### Example

```typescript
import OpenAI from 'openai';

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

const vault = await client.beta.agents.vaults.retrieve('vault_id');

console.log(vault.id);
```

#### 200 — Example

```json
{
  "id": "id",
  "created_at": 0,
  "metadata": {
    "foo": "string"
  },
  "name": "name",
  "object": "vault"
}
```
