# Get Started

This guide helps you make your first API call to TiDB Cloud API. You'll learn how to authenticate a request, build a request, and interpret the response.

## Prerequisites

To complete this guide, you need to perform the following tasks:

- Create a [TiDB Cloud account](https://tidbcloud.com/free-trial)
- Install [curl](https://curl.se/)

## Step 1. Create an API key

To create an API key, log in to your TiDB Cloud console. Navigate to the **Organization Settings** page, and create an API key.

An API key contains a public key and a private key. Copy and save them in a secure location. You will need to use the API key later in this guide.

For more details about creating API key, refer to [API Key Management](#section/Authentication/API-Key-Management).

## Step 2. Make your first API call

### Build an API call

TiDB Cloud API call have the following components:

- **A host.** The host for TiDB Cloud API is <https://iam.tidbapi.com>.
- **An API Key**. The public key and the private key are required for authentication.
- **A request.** When submitting data to a resource via `POST`, `PATCH`, or `PUT`, you must submit your payload in JSON.

In this guide, you call the [List all accessible API Keys](#tag/API-Key/paths/~1apikeys/get) endpoint. For the detailed description of the endpoint, see the [API reference](#tag/API-Key/paths/~1apikeys/get).

### Call an API endpoint

To get all projects in your organization, run the following command in your terminal. Remember to change `YOUR_PUBLIC_KEY` to your public key and `YOUR_PRIVATE_KEY` to your private key.

```shell
curl --digest \
  --user 'YOUR_PUBLIC_KEY:YOUR_PRIVATE_KEY' \
  --request GET \
  --url https://iam.tidbapi.com/v1beta1/apikeys
```

## Step 3. Check the response

After making the API call, if the status code in response is `200` and you see details about all the projects in your organization, your request is successful. Here is an example of a successful response.

```log
{
	"apiKeys": [{
		"name": "orgs/1/apiKeys/2",
		"accessKey": "ABCDEFGH",
		"secretKey": "********************************0000",
		"displayName": "New Key",
		"role": "org:owner"
	}],
	"nextPageToken": ""
}
``` 
