Discovery
Fetch the auth file from Encrata’s API host: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 asENCRATA_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.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
402response. Ask the user to add credits or raise the key’s cap.
Error handling
Branch on the HTTP status, then onresult.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
- Use only
https://developer.encrata.com.encrata.comandapp.encrata.comare the website and dashboard, not the API. - Never request, store, or send the user’s password.
- Keep the key out of URLs, logs, and anything you echo back to the user.
- Verify the key with
/api/account/creditsbefore spending credits. - Stop on
401,402, and403. Back off on429and5xx.
Removed access
If a previously working key returns401, do not retry and do not try to create a replacement. Ask the user to provide a new key.