# Get a key

> Apply for access, sign in, and make the API key that your code or your AI agent sends.

A key lets your code or your AI agent call the hosted DarkCrawl API. Access is by application, and a person reads each one.

1. [Apply](https://app.darkcrawl.dev/apply). Give your company, your work email, your company’s website, your role and what you will use DarkCrawl for. Use a work address: a free mail address is not accepted. You also accept the [Terms](https://darkcrawl.dev/terms/).
2. Confirm your email. We send you a link. Open it and press **Confirm my email**. The link works once and expires 24 hours after you applied.
3. Wait for the review. A person reads your application and emails you when it is decided.
4. [Sign in](https://app.darkcrawl.dev/sign-in) with your email. We send you a link. Open it and press **Sign in**. The link lasts 15 minutes and works once.
5. Open [API keys](https://app.darkcrawl.dev/keys), press **Create key**, and name it. Copy the key. It is shown once.

## Keep the key safe

Keep the key in the `DARKCRAWL_API_KEY` environment variable, or in your secret store, and not in your code. The samples in these docs read it from there. DarkCrawl keeps only a hash of the key, so a lost key cannot be shown again: revoke it and make another. [Authentication](https://darkcrawl.dev/docs/api-reference/authentication/) says how to send it.

## Who sees a key

- Every member of your company can make keys.
- A member sees and revokes their own keys. The owner of the company sees and revokes every key.
- The owner is emailed when a key is made, up to a daily number of emails. The email names the key, shows its first characters and who made it, and never holds the whole key. Every key is on the API keys page.
- When a member is removed from the company, the keys they made stop working immediately.

## How many keys

Every live key of the company counts toward one limit. A trial allows 3 keys. A revoked key no longer counts. Past the limit, making a key is refused with `402 QUOTA_EXCEEDED`. See [Plans and limits](https://darkcrawl.dev/docs/plans-and-limits/) to ask for more.

## Replace a key

1. Make a new key.
2. Switch your code, or your agent, to the new one.
3. Revoke the old key. Calls that use it stop straight away.

Do it in that order, so nothing that is running loses its key.
