> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sentfrom.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# For AI agents

> Everything an AI agent needs to integrate SentFromAI itself.

This page is written for **AI agents** (and the developers building them). If you're an
agent reading this to implement SentFromAI, you have everything you need below.

<Tip>
  **Shortest path** — paste this into your agent and it sets everything up itself:

  ```text theme={null}
  Set up SentFromAI email for yourself: fetch https://docs.sentfrom.ai/agent-install.md
  and follow it. Ask me for the API key when you need it.
  ```

  Details: [Agent self-install](/agent-install).
</Tip>

## Ingest the whole docs

The full documentation is available as a single plaintext file optimized for LLMs:

```
https://docs.sentfrom.ai/llms-full.txt
```

There's also an index at [`/llms.txt`](https://docs.sentfrom.ai/llms.txt). Append `.md` to any
docs page URL to get its raw Markdown.

## The essentials

* **Base URL:** `https://api.sentfrom.ai/v1`
* **Auth:** `Authorization: Bearer sf_live_…` on every request ([details](/authentication)).
* **Format:** JSON in, JSON out. Errors are `{ "error": "…" }` with standard status codes ([reference](/guides/errors)).

## The core loop

Most agents follow the same loop. Each step links to its full reference:

<Steps>
  <Step title="Create an inbox">
    `POST /inboxes { local_part }` → an address like `agent@mail.sentfrom.ai`, live immediately. ([Inboxes](/concepts/inboxes))
  </Step>

  <Step title="Send mail">
    `POST /messages { inbox_id, to, subject, text }`. Use `client_id` for idempotent retries. ([Sending](/concepts/sending))
  </Step>

  <Step title="Receive mail">
    Register a [webhook](/concepts/receiving) for `message.received`, or stream events over the
    [realtime WebSocket](/guides/realtime), or poll `GET /messages`.
  </Step>

  <Step title="Reply in thread">
    `POST /messages/{id}/reply { text }` — threading headers are set for you. ([Threads](/concepts/threads))
  </Step>
</Steps>

## Use it as native tools (MCP)

Rather than calling the REST API, connect the **[SentFromAI MCP server](/guides/mcp)** —
[`sentfromai-mcp` on npm](https://www.npmjs.com/package/sentfromai-mcp) — and all of the
above becomes 21 tools the model calls directly:

```json theme={null}
{
  "mcpServers": {
    "sentfromai": {
      "command": "npx",
      "args": ["-y", "sentfromai-mcp"],
      "env": { "SENTFROMAI_API_KEY": "sf_live_…" }
    }
  }
}
```

Running [OpenClaw](/frameworks/openclaw), [LangChain, CrewAI, or another
framework](/frameworks/overview)? There's a per-framework recipe for each.

## Worked examples

<CardGroup cols={2}>
  <Card title="Auto-reply agent" icon="robot" href="/examples/auto-reply-agent">
    Webhook → generate a reply → send it in thread.
  </Card>

  <Card title="Email labeling agent" icon="tags" href="/examples/labeling-agent">
    Classify inbound mail and apply labels.
  </Card>
</CardGroup>

<Note>
  Get a key from the [dashboard](https://console.sentfrom.ai) → **API keys**. The free plan gives
  5 inboxes, 5,000 emails/month, and 5 GB of attachment storage — enough to run a real
  agent, not just a demo. Paid plans start at \$19/mo for 100 inboxes and 20,000 emails.
</Note>
