Auth and API keys
Auth and API keys
Desearch authenticates REST calls with an API key. Create the key in Desearch Console, store it as an environment variable, and send it on every request.
1. Create a key
- Open Desearch Console.
- Go to API Keys.
- Create a key and copy it once. Store it as
DESEARCH_API_KEYon your server.
2. Send the header
Preferred (raw key):
bash
OpenAPI names this scheme ApiKeyAuth: API key in the Authorization header.
3. Rotate and revoke
- Rotate keys when someone leaves the team or a key may have leaked.
- Revoke old keys in Console after the new key is deployed.
- Prefer separate keys per environment (dev / staging / prod).
4. What not to do
- Do not put API keys in frontend bundles, mobile apps, or public repos.
- Do not paste production keys into screenshots, tickets, or chat.
- Do not treat Desearch 2.0 proposed APIs as live.
Agents vs Humans
| Audience | What to do |
|---|---|
| Humans | Create and rotate keys in Console. Set environment variables on your host. |
| Agents | Read DESEARCH_API_KEY from the environment. Never hard-code a key. |