---
title: "Create API key"
method: POST
path: "/v1/api-keys"
tags: ["api_keys"]
---

# Create API key

`POST /v1/api-keys`

Create a new API key.

Args:
    params: The parameters for creating the API key.

Returns:
    ApiKeyCreated: The response containing the details of the created API key.

## Request body

- ApiKeyCreateParams — Parameters for creating an API key.
  - `name` string — A name/description for the API key
  - `scope` Scope[], nullable — The scope of the API key
    - `method` 'read' | 'write' | 'delete' | 'list' | 'create' | 'search', required
    - `resource_type` 'store' | 'completions', nullable
    - `resource_id` union
      - string
      - string, uuid
  - `expires_at` string, date-time, nullable — Optional expiration datetime

## Response `201`

The created API key details

- ApiKeyCreated — Response model for creating an API key.
  - `id` string, required — The ID of the API key
  - `name` string, required — The name of the API key
  - `redacted_value` string, required — The redacted value of the API key
  - `expires_at` string, date-time, nullable — The expiration datetime of the API key
  - `created_at` string, date-time, required — The creation datetime of the API key
  - `updated_at` string, date-time, required — The last update datetime of the API key
  - `last_active_at` string, date-time, nullable — The last active datetime of the API key
  - `object` 'api_key' — The type of the object
  - `scope` Scope[], nullable — The scope of the API key
    - `method` 'read' | 'write' | 'delete' | 'list' | 'create' | 'search', required
    - `resource_type` 'store' | 'completions', nullable
    - `resource_id` union
      - string
      - string, uuid
  - `value` string, required — The value of the API key

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-24** `88bcf0a5d27e` — 2 breaking, 2 warning, 3 info
  - request property `scope/anyOf[subschema #1]/items/resource_type/anyOf[subschema #1]/` was restricted to a list of enum values
  - the `` response property const value `store` was removed for the status `201`
  - added the new `completions` enum value to the `scope/anyOf[subschema #1]/items/resource_type/anyOf[subschema #1]/` response property for the response status `201`
  - added the new `store` enum value to the `scope/anyOf[subschema #1]/items/resource_type/anyOf[subschema #1]/` response property for the response status `201`
  - …3 more

[Change history](https://skmtc.dev/mixedbread/apis/mxbai-omni/changes/v1/api-keys/post.md)

---

[API](https://skmtc.dev/mixedbread/apis/mxbai-omni.md) · [All operations](https://skmtc.dev/mixedbread/apis/mxbai-omni/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mixedbread/mxbai-omni/revisions/79d5edfa05e3/schema)
