> ## Documentation Index
> Fetch the complete documentation index at: https://docs.donate.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# API keys

> Get a key from the Developer portal and keep it on your server

You need a key to create configs, list your configs, read your project's totals and request a
charity. Every other read works without one, at a lower rate limit. An integration that runs on
your backend sends the key on every call.

## Get a key

Access to the Developer portal is by invitation for new accounts. If you do not have one, email
[support@donate.gg](mailto:support@donate.gg).

**1. Sign in**

Open the [Developer portal](https://developer.donate.gg/login) and sign in with your email. You
get a one-time code.

**2. Create an organization and a project**

The first sign-in walks you through creating an organization. Create a project inside it.
Configs and their totals belong to the project.

**3. Create a key**

Open the project's **API Keys** page and choose **Create Key**. Copy the key now. It is shown
once.

A project can have as many keys as you need. Invite teammates to the organization to share it.

## Use the key

Send it in the `donate-api-key` header:

```bash theme={null}
curl "https://api.donate.gg/api/v2/configs" \
  -H "donate-api-key: $DONATE_API_KEY"
```

[Authentication](https://docs.donate.gg/api/authentication.md) lists which operations require it.

## Keep it on your server

* Call the API from your server, never from a browser or a mobile app. The API allows browser
  requests from Donate's own sites only, so a call from your web page fails, and a key in
  client code is a key anyone can copy.
* Keep the key in an environment variable or a secret store. Do not commit it.
* If a key leaks, revoke it on the project's **API Keys** page and create another.

## Limits

Access is free and every organization gets the same features. A new organization starts at 50
requests a minute, shared by all its keys. See [Rate limits](https://docs.donate.gg/api/rate-limits.md).

## Runnable check

```bash theme={null}
export DONATE_API_KEY="your key"

# Lists the configs your project created. { "items": [], "nextCursor": null } is a valid answer for a new project.
curl "https://api.donate.gg/api/v2/configs?limit=5" \
  -H "donate-api-key: $DONATE_API_KEY"

# Without a key the same call answers 401 UNAUTHENTICATED.
curl -i "https://api.donate.gg/api/v2/configs?limit=5"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.