Where to find it
The file is served from the website:https://app.encrata.com/auth.md. The API host (developer.encrata.com) doesn’t serve the file.
Agents discover it by:
- Reading documentation or SDK pointers
- Fetching the canonical URL directly
- Following links from AI tool configurations (Cursor, Claude Code, Windsurf)
Last updated date and its canonical URL at the top, so an agent can tell whether a cached copy is stale.
Sections in order
The file is a numbered walkthrough an agent follows top to bottom.Title and summary table
A one-line title (# auth.md), a short preamble addressed to the agent, and a table of the facts an agent needs before anything else:
The file doesn’t list every endpoint. It points agents to the docs index and the endpoint list instead.
1. Get a key: supplied by the user, never through chat
Tells the agent where to look for the key, in order:ENCRATA_API_KEY in its environment, then a project .env file the user pointed it to. If the key is already set, the agent uses it and doesn’t ask again.
If there is no key, the agent asks the user to create one and set it as ENCRATA_API_KEY. The user signs in at https://app.encrata.com, opens API Keys, clicks Create API key, and copies the key (it starts with enc_). The user never pastes the key into the chat. The agent also suggests a credit limit that fits the task, since keys have no permission scopes.
The agent must never ask for the user’s password or sign in on the user’s behalf. Encrata has no password-login endpoint for agents.
If the user pastes a key into the chat anyway, the agent doesn’t use it. It asks the user to revoke the key and set a new one as ENCRATA_API_KEY.
2. Use the key
Shows the key sent as a Bearer token on every request, read from the environment at the moment of the call:$ENCRATA_API_KEY instead of typing the key, so it never lands in shell history, logs, commits, or anything echoed back to the user.
3. Verify the key
Before spending credits, the agent confirms the key works with a free call:200 means the key is valid. credits_remaining is the account balance.
4. Key facts
5. Errors
Errors are JSON. On authentication and rate-limit failures the body looks like this:result.code, and never on message. They include request_id when reporting a problem. See Errors for the full list.
6. Rate limits
- 200 requests per minute per account, shared by every key.
- Every API response includes:
X-Ratelimit-Limit: the limit (200)X-Ratelimit-Remaining: requests left in the current windowX-Ratelimit-Reset: seconds until the window resets (not a timestamp)
429responses don’t include aRetry-Afterheader. UseX-Ratelimit-Reset.
7. Revocation
The user revokes keys under API Keys in the dashboard. The agent finds out through a401 on a key that used to work, drops it, and asks the user to update ENCRATA_API_KEY.
8. Rules for agents
- Call the API at
https://developer.encrata.comwith the key fromENCRATA_API_KEY.encrata.comandapp.encrata.comare the website and dashboard, not the API. - Never ask for a key in chat, and never use one that was pasted there.
- Never request, store, or send the user’s password.
- Keep the key out of commands, URLs, logs, and anything echoed back. Reference
$ENCRATA_API_KEY. - Verify the key with
/api/account/creditsbefore spending credits. - Stop on
401,402, and403. Back off on429and5xx.
Optional: the Encrata CLI
A closing note says theencrata CLI reads the same ENCRATA_API_KEY variable, and that an agent doesn’t need it to use the API.
How agents parse it
Agents treatauth.md as both prose and structured data:
- Read the summary table first to learn the host, header, and key format
- Follow the numbered steps in order: get a key, use it, verify it
- Extract code blocks as templates for HTTP requests. Fenced blocks with language hints (
http,json) let agents identify request shapes without ambiguity - Branch on status and
result.codeusing the errors table - Follow the docs index to find endpoints beyond the examples
auth.md.