> For the complete documentation index, see [llms.txt](https://cde-inc.gitbook.io/cde-cad-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cde-inc.gitbook.io/cde-cad-documentation/setup/setup-api-key.md). Agents can also search and read this documentation through its [MCP server](https://cde-inc.gitbook.io/cde-cad-documentation/~gitbook/mcp).

# API Key Setup

To integrate your FiveM server with CDE CAD, you need to generate an API key from the admin panel. This key authenticates every request your server makes to the CAD system through the various CDE CAD integrations.

## Generate Your API Key

Navigate to **Admin Panel > FiveM Settings** in your CDE CAD dashboard. Click **Generate API Key** to create a new key for your server.

## Authentication

{% hint style="info" %}
Your API key will follow this format:
{% endhint %}

```
fvm_a1b2c3d4e5f6...  (64 hexadecimal characters)
```

### Authenticate Requests

{% hint style="warning" %}
Include your API key in the `x-api-key` header on every authenticated request:
{% endhint %}

```
x-api-key: fvm_your_api_key_here
```

## Configure Your Resource

For security reasons, CAD credentials are now stored in your `server.cfg` file rather than in resource files. Add the following block to your `server.cfg`:

```
##CDECAD
set CDE_CAD_API_URL "https://cdecad.com"
set CDE_CAD_API_KEY "fvm_your_api_key_here"
set CDE_CAD_COMMUNITY_ID "YOUR_DISCORD_GUILD_ID"
set CDE_CAD_SERVER_NAME "My RP Server"
```

Your resource reads these convars at runtime, so there is no `config.lua` to edit.

{% hint style="danger" %}
**Security Warning**

* Never expose your API key in client-side scripts. Keep it in `server.cfg` or other server-side files only.
* If your key is compromised, regenerate it immediately from the admin panel.
* Do not commit your `server.cfg` or API key to public repositories.
  {% endhint %}

## Base URL

All API endpoints in this documentation are relative to your CAD instance URL. If you use a custom domain, replace `https://cdecad.com` with your own CDE CAD instance URL in `CDE_CAD_API_URL`. For example:

```
set CDE_CAD_API_URL "https://cad.yourdomain.com/api"
```

Or with a subdomain slug:

```
set CDE_CAD_API_URL "https://ssrp.cdecad.com/api"
```

Set your subdomain slug (for example, `ssrp`) to match your CDE CAD instance.

{% hint style="info" %}
Ready to build? Head over to the [FiveM Developer Integration](https://cde-inc.gitbook.io/cde-cad-documentation/fivem-developer-integration/fivem.md) guide to wire up 911, panic, livemap, character sync, banking, and more.
{% endhint %}
