---
title: "Regenerate Api Key"
method: POST
path: "/api/v1/api-keys/{key_id}/regenerate"
tags: ["API Keys"]
---

# Regenerate Api Key

`POST /api/v1/api-keys/{key_id}/regenerate`

## Request

- Base URL: `https://app.aimrank.io` (the document declares no server; this is the origin it was published from)
- URL: `https://app.aimrank.io/api/v1/api-keys/{key_id}/regenerate`
- Auth: none declared

Regenerate an API key.

This invalidates the old key and creates a new one with the same settings.
⚠️ The new key is only shown once!

Requires a Pro plan or higher. Regeneration mints a brand-new secret, so
leaving it open let a lapsed subscriber re-arm API access indefinitely
from a key issued while they were paying — `create` was gated and this
was not, which made the create gate decorative after the first key.

## Path parameters

- `key_id` string, required

## Response `200`

Successful Response

- APIKeyCreatedResponse: Response when creating a new API key - includes the full key.
  - `id` string, required
  - `name` string, required
  - `key_prefix` string, required
  - `scopes` string[], required
  - `rate_limit` integer, required
  - `is_active` boolean, required
  - `expires_at` string, date-time, nullable, required
  - `last_used_at` string, date-time, nullable, required
  - `usage_count` integer, required
  - `created_at` string, date-time, required
  - `api_key` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/aimrank/apis/aimrank-api.md) · [All operations](https://skmtc.dev/aimrank/apis/aimrank-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aimrank/apis/aimrank-api/revisions/3574d0aff459?raw)
