---
title: "Use Cloud APIs"
description: "Automate Aerospike Cloud resource usage using public APIs for cluster creation, modification, and deletion."
---

# Use Cloud APIs

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

This page describes how to automate creating, modifying, and deleting clusters programmatically in Aerospike Cloud.

## Prerequisites

-   You have an active Aerospike Cloud account

## Create an API key

1.  Create an API key.
    
    In the Aerospike Cloud Console, navigate to **Access manager** > **API keys** and click **Create API key**. Enter a name and click **Generate key**. Copy the **Key ID** and **Secret** (or download the CSV) and store them securely.
    
    ::: note
    The secret is shown only once!
    :::
    
2.  Use the key to authenticate.
    
    Use the **Key ID** as `client_id` and the **Secret** as `client_secret` to obtain a bearer token for the Aerospike Cloud APIs. See [Calling Cloud APIs](#calling-cloud-apis) for the token request example.
    
    ::: note
    The Key ID is shown when the key is generated and can also be found in the API keys table. API keys do not expire. Protecting these credentials is your responsibility.
    :::
    

## Calling Cloud APIs

The OpenAPI specification for the Aerospike Cloud APIs is available: [Public APIs](https://aerospike.com/docs/cloud/reference/api/)

The following example uses the API key to generate a bearer token for Aerospike Cloud APIs:

Terminal window

```bash
curl --request POST \

  --url https://auth.control.aerospike.cloud/oauth/token \

  --header 'content-type: application/json' \

  --data '{"client_id":"<KEY_ID>","client_secret":"<KEY_SECRET>","grant_type":"client_credentials"}'
```

That bearer token can then be used to communicate with the Aerospike Cloud APIs. For example:

Terminal window

```bash
curl -X GET "https://api.aerospike.com/v1/database/clusters/<CLUSTER_ID>/vpc-peerings" \

    -H "Authorization: Bearer <YOUR_TOKEN>"
```