> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# API key authentication

API keys authenticate your requests to the Brevo API. Generate an API key from your account settings and include it in the `api-key` header for each request.

## Requirements

You need a Brevo account. [Sign up](https://onboarding.brevo.com/account/register) if you don't have one yet.

## Generate an API key

### Access account settings

Log in to your Brevo account and open the [SMTP & API settings page](https://app.brevo.com/settings/keys/api).

### Generate new API key

Under the **API keys** tab, click **Generate a new API key**.

![SMTP & API settings](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/brevo.docs.buildwithfern.com/314807d6523d05ae4f3b33fb299aacf96ace5e0e685b70360c72bd942d142ee4/docs/assets/images/f329c79-small-Screenshot_2023-05-16_at_14.48.33.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260914%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260914T072350Z&X-Amz-Expires=604800&X-Amz-Signature=8f235d64b2adc177db53b577268efd972ea943b555f2e0587c0b9de76e54620b&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

### Name your API key

Enter a descriptive name for your API key (e.g., "Production API", "Development API").

![Name API key](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/brevo.docs.buildwithfern.com/e17c4ff16f4f7e79aa3d015a2afb1d71729828946148b7690146ea9aeebd0d75/docs/assets/images/name-key.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260914%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260914T072350Z&X-Amz-Expires=604800&X-Amz-Signature=cab239fc51f4cd59dd812cb2882e978f0efe9f00db5ed8ec5ba51aec77a78a72&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

### Generate the key

Click **Generate**. The API key is displayed once.

![API key generated](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/brevo.docs.buildwithfern.com/e8764fb6f5a6493ca1fafffd96862ea0c2905e2068160f619e00f73dd47dc607/docs/assets/images/blured-key.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260914%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260914T072350Z&X-Amz-Expires=604800&X-Amz-Signature=eae106d522bd8f89498a4adeb3a3f37661c534b3ec6ca38418830bb99a97e57b&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

### Copy and save your API key

Copy the API key immediately and store it securely. You can't view it again after closing the dialog.

Store your API key securely. If you lose it, generate a new one. Treat API keys like passwords — never commit them to version control or share them publicly.

### Whitelist your IP address (optional)

To use your API key in the developer portal playground, whitelist your current IP address. See [IP security](/docs/ip-security) for instructions.

Whitelist your IP address

## Use your API key

Include your API key in the `api-key` header for all API requests. The endpoint below validates your API key and returns your account details.

Your API key identifies your account and authorizes API access. Include it in every request to authenticate your calls.

### Request

GET [https://api.brevo.com/v3/account](https://api.brevo.com/v3/account)

**`response`**

```curl response
curl https://api.brevo.com/v3/account \
     -H "api-key: <apiKey>"
```

**`response`**

```typescript response
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.account.getAccount();
}
main();

```

**`response`**

```python response
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.account.get_account()

```

**`response`**

```php response
<?php

namespace Example;

use Brevo\Brevo;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->account->getAccount();

```

**`response`**

```go response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/account"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`response`**

```ruby response
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/account")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

**`response`**

```java response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.brevo.com/v3/account")
  .header("api-key", "<apiKey>")
  .asString();
```

**`response`**

```csharp response
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/account");
var request = new RestRequest(Method.GET);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

**`response`**

```swift response
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/account")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Request

GET [https://api.brevo.com/v3/account](https://api.brevo.com/v3/account)

**`response`**

```curl response
curl https://api.brevo.com/v3/account \
     -H "api-key: <apiKey>"
```

**`response`**

```typescript response
import { BrevoClient } from "@getbrevo/brevo";

async function main() {
    const client = new BrevoClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.account.getAccount();
}
main();

```

**`response`**

```python response
from brevo import Brevo

client = Brevo(
    api_key="YOUR_API_KEY_HERE",
)

client.account.get_account()

```

**`response`**

```php response
<?php

namespace Example;

use Brevo\Brevo;

$client = new Brevo(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->account->getAccount();

```

**`response`**

```go response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/account"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`response`**

```ruby response
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/account")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

**`response`**

```java response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.brevo.com/v3/account")
  .header("api-key", "<apiKey>")
  .asString();
```

**`response`**

```csharp response
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/account");
var request = new RestRequest(Method.GET);
request.AddHeader("api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

**`response`**

```swift response
import Foundation

let headers = ["api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/account")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

Try your API key