---
title: "Create API Key"
method: POST
path: "/api_keys"
tags: ["api-keys"]
---

# Create API Key

`POST /api_keys`

Endpoint for creating a new API key with a user-provided public key.  This endpoint allows users with Premier or Market Maker API usage levels to create API keys by providing their own RSA public key. The platform will use this public key to verify signatures on API requests.

## Request body

- CreateApiKeyRequest
  - `name` string, required — Name for the API key. This helps identify the key's purpose
  - `public_key` string, required — RSA public key in PEM format. This will be used to verify signatures on API requests
  - `scopes` ApiKeyScope[] — List of scopes to grant to the API key. If the broad `write` parent scope is included, `read` must also be included. Child scopes may be granted without the broad parent scope. Defaults to full access (`read`, `write`) if not provided.
  - `subaccount` integer — If set, restricts the API key to a single sub-account (0-63) that you own. A restricted key may only read and trade on that sub-account; it cannot act on other sub-accounts, transfer funds between sub-accounts, or create sub-accounts. Omit to leave the key unrestricted.

## Response `201`

API key created successfully

- CreateApiKeyResponse
  - `api_key_id` string, required — Unique identifier for the newly created API key

## Other responses

- `400` — Bad request - invalid input
- `401` — Unauthorized
- `403` — Forbidden - insufficient API usage level
- `500` — Internal server error

---

[API](https://skmtc.net/kalshi/apis/kalshi-trade-api-manual-endpoints.md) · [All operations](https://skmtc.net/kalshi/apis/kalshi-trade-api-manual-endpoints/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kalshi/kalshi-trade-api-manual-endpoints/versions/6e6402bf667d/schema)
