Blueping

Give your Vercel AI SDK agent its own email address.

Each call becomes a tool, so the model makes an inbox, waits for its code and replies, in one run.

agent.js
import { tool } from "ai";
import { z } from "zod";
import { createInbox } from "./blueping-tools.js";

const create_inbox = tool({
  description: "Create an email inbox that receives at once.",
  inputSchema: z.object({ username: z.string() }),
  execute: ({ username }) => createInbox(username),
});
The calls it wraps are in blueping-tools.js, in the setup below.

Get an address Agents /integrations/vercel-ai-sdk.md

Blueping makes email inboxes for AI agents: one API call gives an agent its own address, with verification codes pulled out and every sender checked.

northbeam-help@blueping.dev

A Next.js route that answers support mail

Jules Martin6:03 PM
to northbeam-help@blueping.dev
How do I export my data?

Is there a way to export all my projects as a CSV file?

Northbeam Help6:03 PM
to Jules Martin

Yes, Jules: open Settings, then Export, and pick CSV. The file reaches you by email within a few minutes.

Northbeam Help · northbeam-help@blueping.dev

Give the AI SDK its email tools in two files

Each Blueping call becomes an AI SDK tool() with a zod inputSchema, and generateText lets the model call them over several steps. The agent gets an address of its own and reads its mail as JSON.

  1. The five calls over fetch

    blueping-tools.js exports the calls the tools wrap. Each one is a fetch to the API with BLUEPING_API_KEY, so the same file runs in a route handler, a script or a worker.

    // blueping-tools.js: an inbox for your agent, in five functions. Node.js 18+, no dependency.
    const API = "https://blueping.dev/v1";
    
    async function call(method, path, body) {
      const response = await fetch(API + path, {
        method,
        headers: { Authorization: `Bearer ${process.env.BLUEPING_API_KEY}`, "Content-Type": "application/json" },
        body: body ? JSON.stringify(body) : undefined,
      });
      return response.json(); // a refusal is { error: { code, message, next_action } }
    }
    
    export const createInbox = (username) => call("POST", "/inboxes", { username, client_id: username });
    export const waitForCode = (inboxId, sender = "") =>
      call("GET", `/inboxes/${inboxId}/code?wait=50${sender ? `&from=${encodeURIComponent(sender)}` : ""}`);
    export const readInbox = (inboxId) => call("GET", `/inboxes/${inboxId}/messages?limit=10`);
    export const sendEmail = (inboxId, to, subject, text) => call("POST", `/inboxes/${inboxId}/messages`, { to, subject, text });
    export const reply = (messageId, text) => call("POST", `/messages/${messageId}/reply`, { text });
  2. The tools and the call

    isStepCount(5) lets the model make an inbox, wait for its code and answer in one run.

    import { generateText, isStepCount, tool } from "ai";
    import { z } from "zod";
    import { createInbox, reply, waitForCode } from "./blueping-tools.js";
    
    const { text } = await generateText({
      model: "anthropic/claude-sonnet-5.5",
      tools: {
        create_inbox: tool({ description: "Create an email inbox that receives at once.", inputSchema: z.object({ username: z.string() }), execute: ({ username }) => createInbox(username) }),
        wait_for_code: tool({ description: "Wait for the next verification code or link.", inputSchema: z.object({ inboxId: z.string(), sender: z.string().optional() }), execute: ({ inboxId, sender }) => waitForCode(inboxId, sender) }),
        reply: tool({ description: "Answer an email in its thread.", inputSchema: z.object({ messageId: z.string(), text: z.string() }), execute: ({ messageId, text }) => reply(messageId, text) }),
      },
      stopWhen: isStepCount(5),
      prompt: "Make an inbox called selbywick-trial and tell me its address.",
    });
    console.log(text);

Checked against AI SDK docs, tools and tool calling on November 22, 2026.

What an AI SDK agent does with its own inbox

  • A route that answers support mail

    A Next.js route receives email.received, generateText drafts the answer with your docs, and reply sends it in the thread.

  • Streaming the steps to your UI

    With streamText, each tool call shows in your interface as it happens: the inbox made, the code read.

  • A run that ends once the answer is sent

    Put hasToolCall("reply") in stopWhen next to the step limit, and the loop stops the moment the reply leaves, with no extra turn for the model.

Before you connect the AI SDK

  • The tools return JSON, so the model reads a refusal's next_action as it reads a success.
  • An onStepEnd callback hands you each step's tool calls and results, so your logs keep which inbox was made and which code was read.

Does it run on the Edge runtime?

Yes: the calls use fetch only, and the key comes from your environment.

Can the AI SDK load the MCP server's tools instead?

Yes: its MCP client reads the tools of the hosted server at https://blueping.dev/mcp, with your key in the request headers. The functions above keep the tool list to the three calls this agent needs.

Give your Vercel AI SDK agent its address.

Free for 3 inboxes. No card.