## Create a vault

`beta.agents.vaults.create(**kwargs) -> Vault`

**post** `/vaults`

Creates a vault for the current project. See [vaults](/api/docs/guides/agents-api/tools/vaults).

### Parameters

- `metadata: Hash[Symbol, String]`

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

- `name: String`

  The name is trimmed before storage. It must contain 1 to 256 UTF-8 bytes after trimming.

  `minLength: 1`, `maxLength: 1048576`

### Returns

- `class Vault`

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

  - `id: String`

    The ID of the vault.

    `minLength: 0`

  - `created_at: Integer`

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

    `format: int64`

  - `metadata: Hash[Symbol, 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.

    `minLength: 0`

  - `object: :vault`

    The object type. Always `vault`.

    - `:vault`

### Example

```ruby
require "openai"

openai = OpenAI::Client.new(api_key: "My API Key")

vault = openai.beta.agents.vaults.create

puts(vault)
```

#### 201 — Example

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