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

# Create a new API key

`POST /v1/api-keys`

## Request

- Base URL: `https://tradewink.fly.dev`
- URL: `https://tradewink.fly.dev/v1/api-keys`
- Auth: HTTP bearer

Generates a new API key. The raw key is returned **once** in the response — store it securely. Requires `trade` permission. Max 5 active keys per user.

## Request body

- CreateAPIKeyRequest
  - `name` string: A label for this key
  - `permissions` string[]: Permission scopes for the key. Admin keys cannot be minted here.

## Response `201`

API key created

- object
  - `ok` true, required
  - `data` object, required: Response payload
    - `key` string: The raw API key. Shown once — store it securely.
    - `prefix` string
    - `name` string
    - `message` string

## Other responses

- `400`: Invalid permissions or max keys reached
- `403`: Insufficient permissions (requires trade)
- `429`: Per-key rate limit exceeded (`code: rate_limited`). Wait `Retry-After` seconds.

---

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