---
title: "Generate API Key"
method: POST
path: "/api/apikey/generate"
---

# Generate API Key

`POST /api/apikey/generate`

Generate a new API key for the authenticated user or superuser.

## Headers

- `Authorization` string — Bearer token for authentication.
- `Credimi-Api-Key` string — User API key or internal admin API key, depending on the endpoint.

## Request body

- HandlersGenerateApiKeyRequest
  - `name` string

## Response `200`

Successful response

- HandlersGenerateApiKeyResponse
  - `api_key` string

## Other responses

- `default` — An unexpected error occurred.

## Changes

> 34 revisions in range; 2 could not be searched.

- **2026-05-15** `3480fda55a73` — 2 info
  - added the new optional `header` request parameter `Authorization`
  - added the new optional `header` request parameter `Credimi-Api-Key`
- **2026-02-17** `39b2cda1a16e` — 1 info
  - api operation id `generateApiKey` removed and replaced with `apiKey.generate`
- **2025-09-09** `22d742cd7c0c` — 4 warning, 4 info
  - removed the optional property `Code` from the response with the `default` status
  - removed the optional property `Domain` from the response with the `default` status
  - removed the optional property `Message` from the response with the `default` status
  - removed the optional property `Reason` from the response with the `default` status
  - …4 more
- **2025-08-05** `a6cfb3a74f48` — 1 info
  - endpoint added
- **2024-10-17** `53644f0719aa` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/forkbombeu/apis/credimi-api/changes/api/apikey/generate/post.md)

---

[API](https://skmtc.dev/forkbombeu/apis/credimi-api.md) · [All operations](https://skmtc.dev/forkbombeu/apis/credimi-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/forkbombeu/credimi-api/revisions/eaad04e53622/schema)
