Discovery
Fetch the auth file:https://docs.encrata.com/llms.txt.
Send every API request to https://developer.encrata.com. encrata.com and app.encrata.com are the website and dashboard, not the API.
Minimum steps to operate
1. Find the key
The only credential is an Encrata API key:enc_ followed by 32 hexadecimal characters. Look for it in this order and stop at the first one that exists:
ENCRATA_API_KEYin your process environment.- A project
.envfile the user has told you to read.
2. If there is no key, ask the user to set one
Don’t ask the user to paste the key into the chat. Tell them:Sign in at https://app.encrata.com, open API Keys, click Create API key and copy the key (it starts withResume the task once the key is set. Encrata keys have no permission scopes, but each key can carry a credit limit. Suggest one that covers the task, so a leaked or runaway key can’t drain the account. If the user pastes a key into the chat anyway, don’t use it. Ask them to revoke it under API Keys and set a new one asenc_). Don’t paste it into this chat. Give the key a credit limit that fits this task. Then set it as the environment variableENCRATA_API_KEYwhere I run - for example in your shell profile, an uncommitted.envfile, or your tool’s secrets settings. Tell me when it’s done.
ENCRATA_API_KEY. A pasted key is now in the transcript, in any logs the user shares, and with the model provider.
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. Read it fromENCRATA_API_KEY at the moment of the call.
- In shell commands, reference the variable (
"Authorization: Bearer $ENCRATA_API_KEY"). Never type the key itself into a command, where it lands in shell history. - Never put the key in a query string, a log, a commit message, a pull request, an error report, a screenshot, or anything you echo back to the user.
Available endpoints
For every other endpoint, see the docs index.
Credits
- All keys in an account share its credits and rate limit.
- A key can have an optional credit limit. Once reached, requests return
402. - Don’t retry a
402response. Ask the user to add credits or raise the key’s limit.
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
- Call the API at
https://developer.encrata.comwith the key fromENCRATA_API_KEY. - 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 you echo back. Reference
$ENCRATA_API_KEY. - Verify the key with
/api/account/creditsbefore spending credits. - Stop on
401,402, and403. Back off on429and5xx.
Removed access
If a key that worked before returns401, don’t retry and don’t try to create a replacement. Drop the value you hold and ask the user to update ENCRATA_API_KEY - not to send a new key in chat.