Skip to main content
auth.md is a single Markdown file that Encrata publishes to tell agents how to authenticate. This page covers where to find it, the sections it contains, and how agents are expected to parse it.

Where to find it

The file is served from the website:
The dashboard serves an identical copy at 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)
The file carries a 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:
The key never goes in a query string. In shell commands the agent references $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:
A 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:
Agents branch on the HTTP status, then on 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 window
    • X-Ratelimit-Reset: seconds until the window resets (not a timestamp)
  • 429 responses don’t include a Retry-After header. Use X-Ratelimit-Reset.

7. Revocation

The user revokes keys under API Keys in the dashboard. The agent finds out through a 401 on a key that used to work, drops it, and asks the user to update ENCRATA_API_KEY.

8. Rules for agents

  1. Call the API at https://developer.encrata.com with the key from ENCRATA_API_KEY. encrata.com and app.encrata.com are the website and dashboard, not the API.
  2. Never ask for a key in chat, and never use one that was pasted there.
  3. Never request, store, or send the user’s password.
  4. Keep the key out of commands, URLs, logs, and anything echoed back. Reference $ENCRATA_API_KEY.
  5. Verify the key with /api/account/credits before spending credits.
  6. Stop on 401, 402, and 403. Back off on 429 and 5xx.

Optional: the Encrata CLI

A closing note says the encrata 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 treat auth.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.code using the errors table
  • Follow the docs index to find endpoints beyond the examples
Keep the file short and high in signal. Anything an agent doesn’t need to authenticate belongs in the main documentation, not in auth.md.