---
title: "Create Api Key"
method: POST
path: "/api/v1/api-keys"
tags: ["API Keys"]
---

# Create Api Key

`POST /api/v1/api-keys`

## 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`
- Auth: none declared

Create a new API key.

⚠️ The full API key is only shown once in this response!
Store it securely - it cannot be retrieved again.
Requires Pro plan or higher.

## Request body

- APIKeyCreate
  - `name` string, required
  - `scopes` string[]
  - `expires_in_days` integer, nullable
  - `allowed_ips` string[], nullable
  - `allowed_rankings` string[], nullable
  - `rate_limit` integer

## Response `201`

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)
