All Products
Search
Document Center

API Gateway:Create a key

Last Updated:Dec 04, 2025

AI Gateway provides key management features that allow you to create, store, and manage keys. All keys are hosted in Key Management Service (KMS) to ensure that your credentials are stored and used securely. This topic describes how to create a key in the AI Gateway console.

Prerequisites

Create a key

  1. Go to the AI Gateway console.

  2. In the navigation pane on the left, click Key.

  3. In the upper-left corner of the page, click Create key. On the Create key page, configure the parameters.

    Note

    If the service-linked role has not been authorized, click Authorization to grant the AliyunServiceRoleForNativeApiGwInvokeKms service-linked role to AI Gateway. For more information, see Service-linked Role.

    Parameter

    Description

    Key Name

    The name of the key.

    Note

    The key name must be unique. It can contain letters, digits, and underscores (_). The name can be up to 64 characters long.

    Credential source

    The storage location of the key. The default value is KMS.

    KMSInstance

    Select the KMS instance where the key is stored.

    KMSPrimary Key

    Select the master key in KMS that is used for encryption.

    KMSCredential value

    The credential that you want to encrypt and store. It is synchronized to KMS as a credential resource.

  4. Click OK to create the key.