---
title: "Mint a new API key for this org (plaintext shown once)"
method: POST
path: "/me/api-keys"
tags: ["self-service"]
---

# Mint a new API key for this org (plaintext shown once)

`POST /me/api-keys`

## Request

- Base URL: `https://api.getmetacognition.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getmetacognition.com/me/api-keys`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/metacognition/apis/tex-api/docs/me/api-keys/post.ts> (a function with typed inputs; its response is checked against the schema)

## Request body

- APIKeyCreateRequest
  - `name` string, nullable: Human-readable label for the key
  - `scopes` string[]

## Response `201`

Successful Response

- APIKeyMinted: Returned exactly once on creation. Includes the plaintext key.
  - `key` APIKeyOut, required: Public view of an API key. Never includes plaintext.
    - `id` string, required
    - `prefix` string, required: Literal prefix string, e.g. tex_live_
    - `display_id` string, nullable: First 8 random chars of the key body, for visual id
    - `name` string, nullable
    - `scopes` string[]
    - `is_active` boolean, required
    - `created_at` string, date-time, required
    - `last_used_at` string, date-time, nullable
    - `revoked_at` string, date-time, nullable
  - `api_key` string, required: Full plaintext key — store this securely; shown once.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/metacognition/apis/tex-api.md) - [All operations](https://skmtc.dev/metacognition/apis/tex-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metacognition/apis/tex-api/revisions/3bef47e50f2e?raw)
