---
title: "Create Api Key"
method: POST
path: "/api_keys/"
tags: ["Authentication"]
---

# Create Api Key

`POST /api_keys/`

Create a new API key.

## Headers

- `X-Chutes-Hotkey` string, nullable
- `X-Chutes-Signature` string, nullable
- `X-Chutes-Nonce` string, nullable
- `Authorization` string, nullable

## Request body

- APIKeyArgs
  - `admin` boolean, required
  - `name` string, required
  - `scopes` ScopeArgs[], nullable
    - `object_type` string, required
    - `object_id` string, nullable
    - `action` 'read' | 'write' | 'delete' | 'invoke'

## Response `200`

Successful Response

- APIKeyCreationResponse — Representation of an API key when it's initially created.
  - `api_key_id` string, required
  - `user_id` string, required
  - `admin` boolean, required
  - `name` string, required
  - `created_at` string, date-time, required
  - `last_used_at` string, date-time, nullable, required
  - `scopes` APIKeyScopeResponse[], nullable, required
    - `scope_id` string, required
    - `object_type` string, nullable
    - `object_id` string, nullable
    - `method` string, nullable
  - `secret_key` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-26** `8d909638091e` — 1 info
  - endpoint added
- **2026-08-22** `05d9af05d87e` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/chutes/apis/fastapi/changes/api_keys/post.md)

---

[API](https://skmtc.dev/chutes/apis/fastapi.md) · [All operations](https://skmtc.dev/chutes/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/chutes/fastapi/revisions/7be1aa2fe1a0/schema)
