Create Confluent Cloud API Keys

API keys are required to produce or consume to your Kafka topic and are required for using Schema Registry. Separate API keys are required for Kafka and Schema Registry. You can create API keys by using either the Confluent Cloud CLI or web interface.

Create API Keys using the CLI

Prerequisites:
  1. Log in to your cluster using the ccloud login command with the cluster URL specified.

    ccloud login
    
    Enter your Confluent Cloud credentials:
    Email: susan@myemail.com
    Password:
    
  2. Create the API key and secret with the Kafka or Schema Registry resource ID (<resource-id>) specified and save the output. You can find the Kafka resource ID by using the ccloud kafka cluster list command. You can find the Schema Registry resource ID by using the ccloud schema-registry cluster describe command.

    ccloud api-key create --resource <resource-id>
    

    Your output should resemble:

    Save the API key and secret. The key/secret is not retrievable later.
    +---------+------------------------------------------------------------------+
    | API Key | KIELS5LZKXCBOT9L                                                 |
    | Secret  | XVLE434R43R532RFSASDeaatawefafeazzzeeeeeelllll4354t5345452432x   |
    +---------+------------------------------------------------------------------+
    

    Tip

    To use an existing API key and secret, run this command with the resource ID (<resource-id>), API key (<api-key>), and API secret (<api-secret>) specified. This command registers an API key and secret created by another process and stores it locally.

    ccloud api-key store <api-key> <api-secret> --resource <resource-id>
    
  3. Associate the Kafka API key and secret with this cluster. This step is not necessary for Schema Registry resources.

    ccloud api-key use <api-key>
    

Create Kafka API Keys in the UI

Prerequisite:
Access to Confluent Cloud with an active cluster.
  1. Sign in to Confluent Cloud at https://confluent.cloud.

  2. Select a cluster name and then click Cluster settings.

  3. Click the API access tab and then click Create key.

    ../../_images/cloud-api-key-create.png

    You should see this output.

    ../../_images/cloud-api-key-confirm.png
  4. Save the Kafka API key and secret.

Create Schema Registry API Keys in the UI

To use Confluent Cloud Schema Registry for managing Kafka clusters, you need an API key specific to Schema Registry.

Prerequisite:
Access to Confluent Cloud with an active cluster.
  1. Sign in to Confluent Cloud at https://confluent.cloud.

  2. Click Schemas on the navigation bar.

  3. Click the API access tab and then click + Add key.

    ../../_images/cloud-api-key-sr.png

    You should see this output.

    ../../_images/cloud-api-key-sr-confirm.png
  4. Save the Schema Registry API key and secret.