Skip to main content
AI agents use Encrata through the same REST API you do. Give the agent an API key and point it at auth.md, and it can authenticate, find endpoints, and call them. The setup is the same in any agent framework or coding assistant.

Prerequisite: create an API key

Create a key in the dashboard and give it a name that identifies the agent, such as support-triage-agent. Set a credit limit on the key so one agent can’t spend the whole balance. Store the key as ENCRATA_API_KEY where the agent runs:
Never hard-code the key in source, and never paste it into a chat with an agent. A pasted key ends up in the transcript and the model provider’s logs. If a key leaks, see Handle a leaked API key.

Point your agent at auth.md

https://encrata.com/auth.md tells an agent how to authenticate, how to verify its key with the free GET /api/account/credits call, and where to find each endpoint. Add it to the agent’s instructions:

Instructions for your agent

See auth.md for what the file contains.

Coding agents

Build your integration with a coding assistant that reads auth.md, writes the code, and runs it.

Cursor

Point Cursor at auth.md.

Claude Code

Build and test from the terminal.

Windsurf

Point Cascade at auth.md.

Docs for agents

Every page in these docs is available as plain text for agents:

Add Encrata as an agent tool

A tool is a function your agent can choose to call. Write it once in plain Python, then register it with your framework’s tool wrapper, such as LangChain’s @tool, CrewAI’s @tool, or LlamaIndex’s FunctionTool.from_defaults.
Keep three things in mind when you write a tool:
  • The docstring is the tool description. The model reads it to decide when to call the tool and how to read the result, so list the real values the endpoint returns and what the call costs.
  • Return errors instead of raising them. A 402 or 429 that raises an exception ends the agent run. A returned message lets the agent tell the user what happened. See Errors and Rate limits.
  • Return only the fields the agent needs. Smaller results cost fewer tokens and are easier for the model to reason about.

Test with safe inputs

Use inputs that don’t belong to real people while you build and test.
Email Identity costs 1,000 credits per lookup, and an agent decides on its own how often to call a tool. Give agents that can call it a key with a low credit limit.

Next steps

auth.md for developers

Key management and system prompts for agents.

Use cases

Real jobs to give your agent, with the fields to check.

Lookups

Every lookup, its input, and its cost.

Credits

What each lookup costs.