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

# API keys

> Create, store, separate, and revoke DreamLayer test and live keys.

# API keys

## What this lets you do

Authenticate server-side requests and separate deterministic testing from paid managed execution.

## What you need

* A DreamLayer account at `platform.dreamlayer.io`
* Access to a server-side environment or secret manager

## Steps

### 1. Choose a mode

* `dlr_test_...` uses the deterministic no-cost contract.
* `dlr_live_...` uses paid managed execution.

### 2. Create and store the key

Create the key in the developer console. The full secret is shown once. Enter it without writing it to shell history:

```bash theme={null}
read -s DREAMLAYER_API_KEY
export DREAMLAYER_API_KEY
```

Never place a key in browser JavaScript, a mobile binary, a URL, a prompt, source control, screenshots, or support messages.

### 3. Revoke a key

Revocation is immediate for new requests. Existing durable execution state remains available only according to the authenticated account contract.

Each beta tester must use an individual key. Shared keys prevent safe attribution and revocation.

## Confirm it worked

An authenticated capabilities request succeeds. After revocation, the same key receives `401` on a new request.

## Common errors

* A lost full secret cannot be displayed again. Revoke it and create a new key.
* A test key does not call a provider or consume credits.
* A live key without an available credit receives `402` before execution.

## Troubleshooting

Check that the key is present only in the server process and that its `dlr_test_` or `dlr_live_` mode matches the intended request.

## Next steps

* [Send your first managed request](/agent-api)
* [Review credit pricing](/pricing)
* [Handle API errors](/agent-api/errors)
