---
title: "Create a vault"
method: POST
path: "/vaults"
tags: ["Vaults"]
---

# Create a vault

`POST /vaults`

## Request

- Base URL: `https://api.openai.com/v1`
- URL: `https://api.openai.com/v1/vaults`
- Auth: HTTP bearer

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

## Request body

- CreateVaultParams: Parameters for creating a vault to store credentials used by agent tools.
  - `name` string: The name is trimmed before storage. It must contain 1 to 256 UTF-8 bytes after trimming.
  - `metadata` object, nullable: Key-value pairs to associate with the vault, such as an application or team identifier.

## Response `201`

The created vault.

- VaultResource: A collection of credentials for MCP servers and OpenAI-hosted environments.
  - `id` string, required: The ID of the vault.
  - `object` 'vault', required: The object type. Always `vault`.
  - `name` string, nullable, required: The human-readable name of the vault, if set.
  - `metadata` object, required: Key-value pairs associated with the vault, such as an application or team identifier.
  - `created_at` integer, required: The Unix timestamp, in seconds, when the vault was created.

## Other responses

- `400`: The request was invalid.
- `401`: Authentication or project context was missing.
- `403`: The API key lacks the required management permission.
- `404`: The requested vault or credential was not found.
- `409`: The request conflicted with the current vault state.
- `500`: An internal error occurred.
- `503`: The service is temporarily unavailable.

## Changes

- **2026-10-05** `7f654af7f94f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/omnistack-sh/apis/openai-api/changes/vaults/post.md)

---

[API](https://skmtc.dev/omnistack-sh/apis/openai-api.md) - [All operations](https://skmtc.dev/omnistack-sh/apis/openai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/omnistack-sh/apis/openai-api/revisions/0a26f104d35f?raw)
