> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whitebit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Sub-Account API Key

> Create a new API key for a sub-account with specified permissions via the WhiteBIT V4 API.



## OpenAPI

````yaml /openapi/private/main_api_v4.yaml POST /api/v4/sub-account/api-key/create
openapi: 3.0.3
info:
  title: WhiteBIT Private HTTP API V4
  description: |
    WhiteBIT Private HTTP API V4 for Main balance changes.

    Base URL: https://whitebit.com

    All endpoints return time in Unix-time format.
    All endpoints return either a JSON object or array.
    For receiving responses from API calls please use http method POST.
  version: 4.0.0
  contact:
    name: WhiteBIT Support
    email: support@whitebit.com
    url: https://whitebit.com
servers:
  - url: https://whitebit.com
    description: WhiteBIT Global Server
  - url: https://whitebit.eu
    description: WhiteBIT EU Server
security:
  - ApiKeyAuth: []
    PayloadAuth: []
    SignatureAuth: []
tags:
  - name: Main Account
    description: Main account balance and operations
  - name: Deposit
    description: Cryptocurrency and fiat deposit operations
  - name: Withdraw
    description: Cryptocurrency and fiat withdrawal operations
  - name: Transfer
    description: Balance transfer operations
  - name: Codes
    description: WhiteBIT codes operations
  - name: Crypto Lending - Fixed
    description: Fixed crypto lending plans
  - name: Crypto Lending - Flex
    description: Flexible crypto lending plans
  - name: Fees
    description: Fee information
  - name: Sub-Account
    description: Sub-account management
  - name: Sub-Account API Keys
    description: Sub-account API key management
  - name: Mining Pool
    description: Mining pool operations
  - name: Credit Line
    description: Credit line information
  - name: JWT
    description: JWT token management
paths:
  /api/v4/sub-account/api-key/create:
    post:
      tags:
        - Sub-Account API Keys
      summary: Create Sub-Account API Key
      description: >
        The endpoint creates a new API key for a
        [sub-account](/glossary#sub-account). Each sub-account supports up to 50
        API keys, independent from the main account and from other sub-accounts.


        <Warning>

        Rate limit: 1000 requests/10 sec.

        </Warning>


        <Note>

        The API does not cache the response.

        </Note>
      operationId: createSubAccountApiKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - subAccountId
              properties:
                type:
                  type: integer
                  description: >-
                    Type of API key (1 - info and trading; 2 - info, trading,
                    deposits, withdraws)
                  enum:
                    - 1
                    - 2
                  example: 1
                subAccountId:
                  type: string
                  description: ID of the sub-account to create the API key for
                  example: 8e667b4a-0b71-4988-8af5-9474dbfaeb51
                title:
                  type: string
                  description: Custom title/name for the API key
                  example: Trading Bot Key
      responses:
        '201':
          description: API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubAccountApiKey'
        '400':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SubAccountApiKey:
      type: object
      properties:
        subAccountId:
          type: string
          description: Sub-account identifier
          example: 8e667b4a-0b71-4988-8af5-9474dbfaeb51
        id:
          type: string
          description: API key identifier
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        title:
          type: string
          description: API key title/name
          example: Trading Bot Key
        isEnabled:
          type: boolean
          description: Whether the API key is enabled
          example: true
        apiKey:
          type: string
          description: API key
          example: pub-key-abc123
        apiSecret:
          type: string
          description: API secret
          example: secret-xyz789
        type:
          type: integer
          description: >-
            API key type (1 - info and trading, 2 - info, trading, deposit and
            withdraw)
          example: 1
        lastActivity:
          type: integer
          description: Last activity timestamp
          example: 1641081600
        restrictAccess:
          type: boolean
          description: Whether access is restricted
          example: false
        accessEndpoints:
          type: array
          description: List of allowed endpoints
          items:
            type: object
            properties:
              name:
                type: string
                description: Endpoint name
                example: /api/v4/main-account/balance
              title:
                type: string
                description: Endpoint title
                example: Get Balance
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-TXC-APIKEY
      description: The public WhiteBIT API key.
    PayloadAuth:
      type: apiKey
      in: header
      name: X-TXC-PAYLOAD
      description: Base64-encoded JSON request body.
    SignatureAuth:
      type: apiKey
      in: header
      name: X-TXC-SIGNATURE
      description: >-
        HMAC-SHA512 signature of the payload, hex-encoded. Computed as
        hex(HMAC-SHA512(payload, api_secret)).

````