---
title: "Generate or rotate a personal API key (logged-in users)"
method: POST
path: "/api/v1/key/generate"
tags: ["Auth"]
---

# Generate or rotate a personal API key (logged-in users)

`POST /api/v1/key/generate`

## Request

- Base URL: `https://api.quantifyme.ai`
- URL: `https://api.quantifyme.ai/api/v1/key/generate`
- Auth: API key in header `X-API-Key`

## Response `200`

Successful response

- TrialKeyResponse: Anonymous trial key, 10,000 credits, browser-bound, rate-limited 5/IP/hr.
  - `api_key` string
  - `credits` integer
  - `is_trial` boolean
  - `user_id` integer
  - `username` string

## Other responses

- `400`: Bad request
- `401`: Invalid or missing API key
- `429`: Rate limit exceeded, or insufficient credits (body carries credits_remaining and credits_required)

---

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