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

    1. Open Desearch Console.
    2. Go to API Keys.
    3. Create a key and copy it once. Store it as DESEARCH_API_KEY on your server.

    2. Send the header

    Preferred (raw key):

    bash
    curl --request POST 'https://api.desearch.ai/desearch/ai/search' \ --header "Authorization: $DESEARCH_API_KEY" \ --header 'Content-Type: application/json' \ --data '{"prompt":"latest AI search API notes","tools":["web"],"count":10}'

    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

    AudienceWhat to do
    HumansCreate and rotate keys in Console. Set environment variables on your host.
    AgentsRead DESEARCH_API_KEY from the environment. Never hard-code a key.