
You do not have to set anything up before your first send: signup gave you an agent called hello. Create a key and put that name in the from field. On a paid plan, a new name there creates another agent on first use.

Open API keys in the dashboard and press New API key. A live key starts mk_live_; a test key starts mk_test_. The full key is shown once — copy it then.
curl -X POST https://api.mails.ai/v1/messages \
-H "Authorization: Bearer mk_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"from": "hello",
"to": "[email protected]",
"subject": "Demo confirmation",
"body_text": "Confirmed for Tuesday at 2pm ET."
}'You get 201 with the new message's id, its status and its from: the agent that sent it, by its API address hello@<your-workspace>.mails.ai. Recipients see the mail from hello.<your-workspace>@send.mails.ai. GET /v1/messages/{id} returns the whole message. [email protected] is our test address: nothing is delivered, and moments later a real reply lands in your agent's inbox, so you see the reply half work before you mail a customer.
// npm install @mailsai/sdk (ESM — use import, not require)
import { createClient } from "@mailsai/sdk";
const mails = createClient(); // reads MAILS_API_KEY
const sent = await mails.send({
from: "hello",
to: "[email protected]",
subject: "Demo confirmation",
body: "Confirmed for Tuesday at 2pm ET.",
});
console.log(sent.from); // hello@<your-workspace>.mails.aiThere is a Python SDK too: pip install mailsai. To drive mails.ai from Claude, ChatGPT or Cursor instead, add https://api.mails.ai/mcp as a connector and sign in. There is nothing to install.