---
title: "Roll a key via magic token"
method: POST
path: "/v1/auth/regenerate"
tags: ["account"]
---

# Roll a key via magic token

`POST /v1/auth/regenerate`

## Request

- Base URL: `https://modelglass-api.vercel.app`
- URL: `https://modelglass-api.vercel.app/v1/auth/regenerate`
- Auth: none required

Public — consumes the magic token (single-use for this action) and rolls the specified key, which must belong to the token's account.

## Request body

- object
  - `token` string, required
  - `keyId` string, required

## Response `201`

New key issued.

- object
  - `ok` true, required
  - `data` object, required
    - `apiKey` string
    - `keyId` string
    - `display` string
    - `tier` 'free' | 'starter' | 'pro' | 'internal' | 'app'
    - `planLabel` string
    - `createdAt` string, date-time
  - `meta` ResponseMeta, required
    - `artifact_version` integer, required
    - `built_at` string, date-time, required
    - `count` integer: Item count when `data` is a collection.

## Other responses

- `400`: Missing token/keyId, or the key isn't active (BAD_REQUEST).
- `404`: Token expired/unknown, or key not found on this account (NOT_FOUND).
- `429`: Free-plan regeneration limit (5/day) reached (RATE_LIMITED).

---

[API](https://skmtc.dev/modelglass/apis/modelglass-read-api.md) · [All operations](https://skmtc.dev/modelglass/apis/modelglass-read-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelglass/apis/modelglass-read-api/revisions/5948ffa60462?raw)
