Skip to main content
POST
/
api_keys
/
generate
Generate API Key
curl --request POST \
  --url https://external-api.kalshi.com/trade-api/v2/api_keys/generate \
  --header 'Content-Type: application/json' \
  --header 'KALSHI-ACCESS-KEY: <api-key>' \
  --header 'KALSHI-ACCESS-SIGNATURE: <api-key>' \
  --header 'KALSHI-ACCESS-TIMESTAMP: <api-key>' \
  --data '
{
  "name": "<string>",
  "scopes": []
}
'
{
  "api_key_id": "<string>",
  "private_key": "<string>"
}

Authorizations

KALSHI-ACCESS-KEY
string
header
required

Your API key ID

KALSHI-ACCESS-SIGNATURE
string
header
required

RSA-PSS signature of the request

KALSHI-ACCESS-TIMESTAMP
string
header
required

Request timestamp in milliseconds

Body

application/json
name
string
required

Name for the API key. This helps identify the key's purpose

scopes
enum<string>[]

List of scopes to grant to the API key. If the broad write parent scope is included, read must also be included. Child write scopes may be granted without the broad parent scope. Defaults to full access (read, write) if not provided.

Scope granted to an API key. Parent scopes grant broad access; for example, read grants all read endpoints and write grants all write endpoints. Child scopes such as write::transfer grant only their specific endpoint group and can be granted without the parent scope.

Available options:
read,
write,
write::transfer

Response

API key generated successfully

api_key_id
string
required

Unique identifier for the newly generated API key

private_key
string
required

RSA private key in PEM format. This must be stored securely and cannot be retrieved again after this response