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

# Create an API key

`POST /v1/api-keys`

## Request

- Base URL: `https://api.ditto.audio` (the document declares no server; this is the origin it was published from)
- URL: `https://api.ditto.audio/v1/api-keys`
- Auth: HTTP bearer

The plaintext `secret` is returned ONCE in this response and is never recoverable afterwards — store it immediately. Use it as `Authorization: Bearer <secret>` on /v1/audio/*.

## Request body

- CreateApiKeyDto
  - `name` string, required: Your label for the key.
  - `scopes` string[]: Defaults to every scope. `audio:speech` = synthesize, `audio:read` = list voices/languages.
  - `expiresAt` string: ISO-8601 expiry. Omit for a key that never expires.

## Response `201`

The new key + its one-time plaintext secret.

## Other responses

- `400`: Missing name, invalid scopes, or key limit reached.

---

[API](https://skmtc.dev/ditto/apis/ditto-audio-api.md) · [All operations](https://skmtc.dev/ditto/apis/ditto-audio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ditto/apis/ditto-audio-api/revisions/30c8d7c218da?raw)
