Skip to main content
This guide is for AI agents that need to call Encrata’s API. If you configure an agent, see For Developers.

Discovery

Fetch the auth file from Encrata’s API host:
The file describes the API host, authentication header, key format, errors, and rate limits. For endpoints, use the docs index at https://docs.encrata.com/llms.txt.

Minimum steps to operate

1. Ask the user for an API key

Tell the user:
Sign in at https://app.encrata.com, open API Keys, click Create API key, copy the key (it starts with enc_) and paste it here.
A key uses enc_ followed by 32 hexadecimal characters. Never ask for the user’s password or sign in on their behalf. Encrata has no password-login endpoint for agents.

2. Store the key securely

Store the key in an environment variable such as ENCRATA_API_KEY. Never write it to logs, chat transcripts, URLs, or version control.

3. Verify the key

Before spending credits, confirm the key works. This call is free.
A 200 means the key is valid. credits_remaining is the account balance.

4. Make API calls

Send the key as a Bearer token on every request. Never put it in a query string.

Available endpoints

Credits

  • All keys in an account share its credits and rate limit.
  • A key can have an optional credit cap. Once reached, requests return 402.
  • Do not retry a 402 response. Ask the user to add credits or raise the key’s cap.

Error handling

Branch on the HTTP status, then on result.code. Never branch on message. Include request_id when reporting a problem. 429 responses don’t include Retry-After. Use X-Ratelimit-Reset, which is a number of seconds, not a timestamp.

Rules

  1. Use only https://developer.encrata.com. encrata.com and app.encrata.com are the website and dashboard, not the API.
  2. Never request, store, or send the user’s password.
  3. Keep the key out of URLs, logs, and anything you echo back to the user.
  4. Verify the key with /api/account/credits before spending credits.
  5. Stop on 401, 402, and 403. Back off on 429 and 5xx.

Removed access

If a previously working key returns 401, do not retry and do not try to create a replacement. Ask the user to provide a new key.