---
title: "Mint a Try It session key"
method: POST
path: "/auth/session-key"
tags: ["authentication"]
---

# Mint a Try It session key

`POST /auth/session-key`

## Request

- Base URL: `https://api.whoisgeni.us` (the document declares no server; this is the origin it was published from)
- URL: `https://api.whoisgeni.us/auth/session-key`
- Auth: HTTP bearer

Mint (or rotate) the in-app "Try It" playground key for this user.

The dashboard/landing Try It panel calls this with the logged-in user's
Cognito JWT, so the panel never depends on a copy-once raw key stashed in
the browser. Each call revokes the prior playground key and returns a fresh
raw value.

Abuse controls (the playground adds NO new spend budget):
  * Minting is capped per user (``session_key_mint_per_hour``).
  * The key is excluded from the per-tier key cap and hidden from GET /keys.
  * Analyses made with it consume the user's normal monthly quota and are
    rate-limited per user_id at ``playground_rate_limit_per_hour`` so
    re-minting cannot reset the hourly window (enforced in deps.py).

## Response `200`

Short-lived playground API key (raw value, shown each call)

- ApiResponseApiKeyResponse
  - `data` ApiKeyResponse: Response body for a single API key. ``raw_key`` is only populated on creation (shown once, never stored).
    - `id` string, uuid, required
    - `name` string, required
    - `key_prefix` string, required
    - `created_at` string, date-time, required
    - `is_active` boolean, required
    - `raw_key` string, nullable
  - `error` ErrorDetail: Structured error information for API error responses. Attributes: code: Machine-readable error code (e.g. "JOB_NOT_FOUND"). message: Human-readable error description. details: Optional additional context for debugging.
    - `code` string, required
    - `message` string, required
    - `details` object, nullable
  - `meta` object, nullable

## Other responses

- `401`: Unauthorized — missing or invalid API key/JWT.

---

[API](https://skmtc.dev/whoisgeni/apis/whoisgenius.md) · [All operations](https://skmtc.dev/whoisgeni/apis/whoisgenius/llms.txt) · [OpenAPI document](https://skmtc.dev/whoisgeni/apis/whoisgenius/revisions/707f1c34f6b3?raw)
