Have a key? Send in three calls
With BLUEPING_API_KEY set, an agent goes straight to sending: create an inbox, send from it, and list its messages. The client_id makes the first call safe to run again: it returns the same inbox.
curl https://blueping.dev/v1/inboxes -H "Authorization: Bearer $BLUEPING_API_KEY" \
-H "Content-Type: application/json" -d '{"client_id": "my-agent"}'
curl https://blueping.dev/v1/inboxes/inb_.../messages -H "Authorization: Bearer $BLUEPING_API_KEY" \
-H "Content-Type: application/json" -d '{"to": "someone@example.com", "subject": "Hello", "text": "Hi"}'
curl "https://blueping.dev/v1/inboxes/inb_.../messages?limit=10" -H "Authorization: Bearer $BLUEPING_API_KEY"import json, os, urllib.error, urllib.request
API, KEY = "https://blueping.dev/v1", os.environ["BLUEPING_API_KEY"]
def call(method, path, body=None):
request = urllib.request.Request(API + path, method=method, data=json.dumps(body).encode() if body else None,
headers={"Authorization": f"Bearer {KEY}", "Content-Type": "application/json", "User-Agent": "my-agent/1.0"})
try:
with urllib.request.urlopen(request, timeout=90) as response:
return json.load(response)
except urllib.error.HTTPError as error:
return json.load(error) # {"error": {"code", "message", "next_action", ...}}
def need(answer):
if "error" in answer:
raise SystemExit(json.dumps(answer, indent=2))
return answer
inbox = call("POST", "/inboxes", {"client_id": "my-agent"})
if "error" in inbox: # every inbox in use: send from the first one
inbox = need(call("GET", "/inboxes"))["data"][0]
sent = call("POST", f"/inboxes/{inbox['id']}/messages", {"to": "someone@example.com", "subject": "Hello", "text": "Hello from my agent"})
print(json.dumps({"inbox": inbox, "send": sent, "messages": call("GET", f"/inboxes/{inbox['id']}/messages")["data"]}, indent=2))const API = "https://blueping.dev/v1";
const call = async (method, path, body) =>
(await fetch(API + path, { method, headers: { Authorization: `Bearer ${process.env.BLUEPING_API_KEY}`, "Content-Type": "application/json" }, body: body && JSON.stringify(body) })).json();
let inbox = await call("POST", "/inboxes", { client_id: "my-agent" });
if (inbox.error) inbox = (await call("GET", "/inboxes")).data?.[0] ?? inbox; // every inbox in use: send from the first one
if (inbox.error) throw new Error(JSON.stringify(inbox.error, null, 2)); // the refusal, with its next_action
const send = await call("POST", `/inboxes/${inbox.id}/messages`, { to: "someone@example.com", subject: "Hello", text: "Hello from my agent" });
const { data: messages } = await call("GET", `/inboxes/${inbox.id}/messages`);
console.log(JSON.stringify({ inbox, send, messages }, null, 2));A key from a person's account writes to anyone. An agent that signed itself up writes to people who wrote to it first, to echo@blueping.dev and to its owner until it is claimed: Agent onboarding.
Quickstart
Three calls, with no key to start. Every call is HTTPS and JSON, and every answer is JSON, refusals included.
1. Sign up your agent
POST /v1/signup makes your agent, its API key and its first inbox, which receives mail now. It needs no key and no person.
curl https://blueping.dev/v1/signup \
-H "Content-Type: application/json" \
-d '{"name": "My agent"}'The answer holds api_key once: keep it in BLUEPING_API_KEY. inbox.id is the inbox you call next, and inbox.address is the address you give to services and people.
{
"api_key": "bp_live_8Hn2Qx5Lw9Tc3Vb8Kp1R4Df6Gh7Jk0",
"account_id": "acct_7Hn2Qx5Lw9Tc3Vb8Kp1R",
"status": "unclaimed",
"inbox": {
"id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"address": "amber-fox-4821@blueping.dev",
"username": "amber-fox-4821",
"display_name": "My agent",
"client_id": null,
"created_at": "2026-11-21T10:00:00.000Z"
},
"limits": { "plan": "free", "claim": { "status": "unclaimed" } },
"claim": { "url": "https://blueping.dev/claim?account=acct_7Hn2Qx5Lw9Tc3Vb8Kp1R" },
"next_action": "Save api_key now: this is the only answer that shows it. ..."
}2. Write to the echo address
echo@blueping.dev answers a Blueping inbox within seconds, with a test code, so this works before anyone else writes to your agent.
curl https://blueping.dev/v1/inboxes/inb_4Kd9Wq1Mz5TbX2Vn7RcP/messages \
-H "Authorization: Bearer $BLUEPING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to": "echo@blueping.dev", "subject": "Hello", "text": "Hello from my agent"}'{
"id": "em_2LwQ8sXe5RmN3HkT9cVb",
"inbox_id": "inb_4Kd9Wq1Mz5TbX2Vn7RcP",
"thread_id": "th_3HkT9cVb2LwQ8sXe5RmN",
"status": "sent",
"echo": "scheduled"
}3. Read the code
GET /v1/inboxes/{id}/code waits on Blueping's side, up to 60 seconds, for the next message with a code or a sign-in link, and returns both.
curl "https://blueping.dev/v1/inboxes/inb_4Kd9Wq1Mz5TbX2Vn7RcP/code?wait=30" \
-H "Authorization: Bearer $BLUEPING_API_KEY"{
"code": "482913",
"link": null,
"message_id": "em_9PzR4fYc1KwM6tDq3VxB",
"thread_id": "th_3HkT9cVb2LwQ8sXe5RmN",
"from": { "address": "echo@blueping.dev", "name": "Blueping Echo" },
"subject": "Re: Hello",
"received_at": "2026-11-21T10:00:02.000Z",
"codes": [{ "value": "482913" }]
}The whole flow in one script
Create an inbox, send to a fixed address, list the messages and print them as JSON. With BLUEPING_API_KEY set it makes an inbox with a client_id, so running it again keeps one. Without a key it signs up first and saves the key in blueping.key.
# Create an inbox, send to a fixed address, list the messages, print them as JSON.
import json, os, urllib.error, urllib.request
API = "https://blueping.dev/v1"
FIXED = "echo@blueping.dev" # answers a Blueping inbox within seconds
def call(method, path, body=None, key=None):
# A User-Agent of your own: the site's firewall refuses urllib's default one.
headers = {"Content-Type": "application/json", "User-Agent": "my-agent/1.0"}
if key:
headers["Authorization"] = f"Bearer {key}"
data = json.dumps(body).encode() if body is not None else None
request = urllib.request.Request(API + path, data=data, headers=headers, method=method)
try:
with urllib.request.urlopen(request, timeout=90) as response:
return json.load(response)
except urllib.error.HTTPError as error:
return json.load(error) # {"error": {"code", "message", "next_action", ...}}
def need(answer):
if "error" in answer:
raise SystemExit(json.dumps(answer, indent=2))
return answer
key = os.environ.get("BLUEPING_API_KEY")
if key:
inbox = call("POST", "/inboxes", {"client_id": "quickstart"}, key)
if "error" in inbox: # every inbox in use: read with the first one
inbox = need(call("GET", "/inboxes", key=key))["data"][0]
else:
agent = need(call("POST", "/signup", {"name": "Quickstart"}))
key, inbox = agent["api_key"], agent["inbox"]
saved = os.open("blueping.key", os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
with os.fdopen(saved, "w") as file: # the key is shown once: keep it, readable by you alone
file.write(key)
box = inbox["id"]
sent = need(call("POST", f"/inboxes/{box}/messages", {"to": FIXED, "subject": "Hello", "text": "Hello from my agent"}, key))
call("GET", f"/inboxes/{box}/messages?since={sent['id']}&wait=30", key=key) # waits for the answer
messages = need(call("GET", f"/inboxes/{box}/messages", key=key))
print(json.dumps(messages, indent=2))// Create an inbox, send to a fixed address, list the messages, print them as JSON. Node.js 18 or later.
import { writeFileSync } from "node:fs";
const API = "https://blueping.dev/v1";
const FIXED = "echo@blueping.dev"; // answers a Blueping inbox within seconds
async function call(method, path, body, key) {
const response = await fetch(API + path, {
method,
headers: { "Content-Type": "application/json", ...(key ? { Authorization: `Bearer ${key}` } : {}) },
body: body ? JSON.stringify(body) : undefined,
});
return response.json(); // a refusal is {"error": {"code", "message", "next_action", ...}}
}
function need(answer) {
if (answer.error) throw new Error(JSON.stringify(answer.error, null, 2));
return answer;
}
let key = process.env.BLUEPING_API_KEY;
let inbox;
if (key) {
inbox = await call("POST", "/inboxes", { client_id: "quickstart" }, key);
if (inbox.error) inbox = need(await call("GET", "/inboxes", undefined, key)).data[0]; // every inbox in use
} else {
const agent = need(await call("POST", "/signup", { name: "Quickstart" }));
({ api_key: key, inbox } = agent);
writeFileSync("blueping.key", key, { mode: 0o600 }); // the key is shown once: keep it
}
const sent = need(await call("POST", `/inboxes/${inbox.id}/messages`, { to: FIXED, subject: "Hello", text: "Hello from my agent" }, key));
await call("GET", `/inboxes/${inbox.id}/messages?since=${sent.id}&wait=30`, undefined, key); // waits for the answer
const messages = need(await call("GET", `/inboxes/${inbox.id}/messages`, undefined, key));
console.log(JSON.stringify(messages, null, 2));It prints the inbox's messages, newest first: the echo's answer with its code, then the message your script sent. held at the end counts what was kept back, here nothing.
With a key from the dashboard
A key from your dashboard belongs to an agent you already own, on Free: up to 3 inboxes and 3,000 emails sent a month. POST /v1/inboxes makes another address; the same client_id again returns the same inbox.
curl https://blueping.dev/v1/inboxes \
-H "Authorization: Bearer $BLUEPING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "acme-support", "display_name": "Acme Support", "client_id": "support"}'One inbox per customer: POST /v1/inboxes/batch makes up to 50 in one call, each with its own client_id, so the same batch sent twice makes nothing twice. Each item answers on its own, 201, 200 for one made before, or its error.
curl https://blueping.dev/v1/inboxes/batch \
-H "Authorization: Bearer $BLUEPING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"inboxes": [{"username": "acme-1", "client_id": "cust_1"}, {"username": "globex", "client_id": "cust_2"}]}'Claim your agent
Until a person claims it, an agent that signed itself up holds 1 inbox and sends 10 emails a day, to people who wrote to it first, to echo@blueping.dev and to its owner. Its owner claims it with a 6-digit code sent to their own email: Agent onboarding has both ways.
Use it over MCP
The hosted MCP server carries the same calls as tools. It lists 10 by default, create_inbox, wait_for_code, list_messages, read_message, send_email, reply_to_email, search_messages, list_inboxes, read_attachment and list_toolsets, and every tool is at https://blueping.dev/mcp/all. In Claude Code:
claude mcp add --transport http blueping https://blueping.dev/mcp
claude mcp login bluepingOne click opens these clients with the server set, and each signs in when it first connects:
Codex, ChatGPT, Claude and every other client, with OAuth or a key, and every tool: Connect over MCP.
Next
- Agent onboarding: how an agent signs itself up, and how its owner claims it.
- Connect over MCP: every client's setup, and every tool with its fields.
- SDKs and languages: a client in a few lines of Node.js, Python, Go, Ruby, PHP, Java or C#.
- API reference: every endpoint, field and error.
- Webhooks:
email.received,email.held,email.sent,email.failedandemail.draft_failed, signed. - Limits: what each plan sends, and the ramp after the claim.