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 or Ed25519 public key in PEM format. The platform will use this public key to verify signatures on API requests: RSA-PSS with SHA-256 for RSA keys, Ed25519 for Ed25519 keys.

post/api_keys

Request

  • Base URL
    https://external-api.kalshi.com/trade-api/v2
  • URL
    https://external-api.kalshi.com/trade-api/v2/api_keys
  • Auth
    API key in header KALSHI-ACCESS-KEY and API key in header KALSHI-ACCESS-SIGNATURE and API key in header KALSHI-ACCESS-TIMESTAMP

Request body

namestring required

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

public_keystring required

RSA or Ed25519 public key in PEM format (-----BEGIN PUBLIC KEY-----). This will be used to verify signatures on API requests - RSA-PSS with SHA-256 for RSA keys, Ed25519 for Ed25519 keys

scopesApiKeyScope[]

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.

subaccountinteger

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. Mutually exclusive with fcm_subtrader_id.

fcm_subtrader_idstring

FCM members only. If set, binds the API key to a single FCM subtrader that you own, spelled {your_user_id}_{suffix} with a suffix of 1-16 case-sensitive ASCII alphanumeric characters. The subtrader must already exist. A bound key is the institution's trading credential for that subtrader - FIX order-entry and market-data sessions, plus margin WebSocket sessions scoped to the subtrader's own data - and is denied on every REST endpoint, including key management. Mutually exclusive with subaccount.

Response

API key created successfully

api_key_idstring required

Unique identifier for the newly created API key

warningstring nullable

Present only when the minted key is bound to an FCM subtrader that is missing a per-subtrader risk control - the initial-margin cap (margin lane) or the event-contract daily cap. The mint still succeeds; the warning names each missing control - an event-contract subtrader without a daily cap has its event-contract orders rejected until one is set, while a margin subtrader without an initial-margin cap is bounded only by firm-level risk limits.

Changes

    • info

      added the new write::fcm_risk enum value to the request property /

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status