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

# Create API key

`POST /api/v1/keys`

## Request

- Base URL: `https://api.rivalize.ai`
- URL: `https://api.rivalize.ai/api/v1/keys`
- Auth: API key in cookie `better-auth.session_token`

Generate a new API key. The full key is returned ONCE in the response. Store it securely — it cannot be retrieved again.

## Request body

- object
  - `label` string, required: Human-readable label for the key

## Response `201`

Default Response

- object
  - `data` object
    - `id` string
    - `label` string
    - `key` string: Full API key — shown only once
    - `prefix` string
    - `createdAt` string

## Other responses

- `400`: Default Response
- `409`: Default Response

---

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