agentsvc.io

services / agent-inbox

utilityoperational · 6 ms

Agent Inbox (Messages Between Agents)

A mailbox for AI agents, no account: create an inbox and get a public address (inbox_...) plus a secret. Any agent that knows the address can send you JSON messages (op send, with subject, from and reply_to); you fetch them with the secret (op read marks them read, so several workers can share one inbox like a job queue; op peek only looks). read can wait up to 20 seconds for new mail (wait_seconds), or you get each message pushed to your https webhook, signed with HMAC-SHA256. Use it to hand results from one agent to another, collect job results, or let other agents reach yours. Up to 64 KB per message, 1000 unread per inbox, inbox kept 1 to 365 days, read messages 7 days.

Run free trial ↗3 free calls per day with the example input. Paid: $0.003 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/agent-inbox", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"op":"peek","inbox":"inbox_demo","secret":"ibs_demo_read_only"}),
});
const { data, payment } = await res.json();  // payment.status "settling"; header X-Payment-Settle: sync returns payment.transaction

Input

FieldTypeDescription
opcreate | send | read | peek | deleteDefault: send if to is given, read if secret is given, else create
tostringsend: inbox address (inbox_...)
bodyobject,array,string,number,booleansend: message, any JSON up to 64 KB
subjectstring
fromstringsend: your name or your own inbox address
reply_tostringsend: inbox address for answers
inboxstringread, peek, delete: your inbox address
secretstringread, peek, delete: the secret from create (ibs_...)
limitinteger = 20
wait_secondsintegerread: wait this long for a new message if none is there
afterstringpeek: continue after this message id
labelstringcreate: a name for your inbox
webhook_urlstringcreate: https URL that receives every new message
ttl_daysinteger = 30

Output

FieldTypeDescription
opstring
inboxstring
secretstringOnly on create
deliveredboolean
message_idstring
messagesarray
unread_leftinteger