# Ezra's API for your own agents and tools

Ezra is a personal assistant people text on WhatsApp. With an Agent Key, a program of yours (another assistant, a script, an automation) sends Ezra a message as you and reads his reply. It is your own conversation with Ezra: he remembers it, and it is the same one you have with him on WhatsApp and in his room.

- Room (for people, in a browser): https://www.worlds.repair/ezra
- API (for programs): https://api.scaleme.app

## 1. Get a key

A person makes the key, not a program:

1. Open https://www.worlds.repair/ezra and link your WhatsApp there.
2. In the room's menu choose **Access**, then **Agent keys**, and make a key. Give it a name you will recognise.
3. Copy the key (`ezk_…`). It is shown once and is never stored, so it cannot be shown again. You can hold up to 5 and revoke any of them in the same place.

A key speaks as you. Whatever a program sends with it counts as your own word to Ezra, including a "yes" to sending an email, placing a call or submitting a form. Give a key only to an agent you would trust with your own chat, and revoke it when you are done.

## 2. Send a message over HTTP

```
POST https://api.scaleme.app/ezra/api/v1/messages
Authorization: Bearer ezk_…
Content-Type: application/json

{"text": "Remind me to call the dentist tomorrow at 9"}
```

Answer:

```
{"ok": true, "reply": "Done. I'll remind you tomorrow at 9:00.", "attachments": []}
```

- `text` is at most 4,000 characters. Send follow-ups as further messages; Ezra keeps the conversation.
- `reply` is everything Ezra said, as text. `attachments` lists anything else he sent: its `kind`, its `name` or `caption` when it has one, and a `url` only when it has a public one. A picture or file Ezra made in the turn has no address a program can fetch; it is in your chat with him.
- A reply can take from a few seconds to a few minutes when Ezra does real work. Keep the connection open, send one message at a time, and wait for its answer: only one message sent with any of your keys is answered at a time.
- **Do not resend blindly.** If the connection drops before the answer arrives, Ezra may already have acted on the message. Sending "yes" or "send it" again can do the thing twice. Ask Ezra what he did instead.

Errors Ezra answers come as `{"ok": false, "error": "…", "message": "…"}`:

- `400 invalid_payload`, `empty_message`, `too_long`: the body is not one non-empty `text` string of at most 4,000 characters.
- `401 invalid_key`: not a key Ezra knows, or its person is no longer linked, or they are deleting their data.
- `401 unlinked`: the key's person is no longer linked to Ezra.
- `402 usage_limit_exceeded`: the message allowance is used up.
- `409 busy`: Ezra is still answering the last message sent with a key of yours.
- `429 slow_down`: too many requests (a key runs at most 30 messages in ten minutes); wait a few minutes.
- `502 turn_failed`: Ezra could not answer. Check whether he acted before sending again.
- `503 unavailable`, `ezra_unavailable`: Agent Keys are switched off, or Ezra cannot be reached right now.

A request the server refuses before it reaches Ezra (a body that is not JSON, or too large) gets the server's own plain error instead.

## 3. Or connect over MCP

For an assistant that speaks the Model Context Protocol:

- Server URL: `https://api.scaleme.app/ezra/mcp` (Streamable HTTP, POST only; it keeps no session)
- Authentication: the header `Authorization: Bearer ezk_…`. Your client has to be able to send a fixed header; there is no sign-in flow.
- One tool, `message_ezra`, taking `{"text": "…"}` and returning Ezra's reply.

## What Ezra can do

Reminders and scheduled tasks, looking things up with sources, reading and sending your email and calendar once you have connected them, phone calls to businesses, using websites with a browser of his own, spreadsheets and documents, and messages to other people. What is switched on today is listed at https://www.worlds.repair/ezra/about.

## House rules

- A key reaches one person's Ezra and nobody else's. Nothing in a request can name another person.
- Ezra asks for a yes before anything leaves your hands. A yes your program sends is your yes.
- Say "delete everything" to Ezra and your data is wiped, your keys with it.
