跳到主要内容

Signing up for Discord? Some of our domains are accepted there. See which ones on the Domains page.

CyberTemp
开发者

专为开发者打造的临时邮箱 API

可用代码驱动的一次性收件箱:通过简单的 REST API 读取邮件,接收 HMAC 签名的 Webhook,接入 MCP 智能体。每个账户都有免费 API 密钥;付费套餐每月 €1.99 起,可提高各项限制。

# Any address on a CyberTemp domain works: the inbox is created on first read.
# $RANDOM gives you a fresh address, so you never share an inbox with someone else.
curl "https://api.cybertemp.xyz/[email protected]" \
  -H "X-API-KEY: tk_..."

# [{"id":"...","from":"[email protected]","subject":"Your code is 482917",
#   "text":"...","html":"...","date":"2026-05-17T09:31:00.000Z"}]

专为这些工作流打造

大多数 CyberTemp API 用户都在做以下三件事之一。

CI/CD 中的邮件测试

在 Playwright、Puppeteer 或 Cypress 测试中使用一次性收件箱。无需共享收件箱,测试数据中也不会泄露密钥。

QA 自动化中的 OTP 流程

让您的注册流程使用一个全新地址,轮询 GET /getMail 并从最新邮件中读取验证码。无需共享收件箱,也不用依赖不稳定的测试邮件服务器。

AI 智能体与 MCP 集成

几秒钟即可将我们的 MCP 服务器接入 Claude 或 Cursor。智能体可自主完成注册、确认以及依赖邮箱的各类流程。

功能

API 密钥认证

按账户发放密钥,按设备发放 CLI 令牌,均可在面板中撤销。

Webhook

Elite+

在您的接口上接收新邮件通知,带 HMAC 签名。

OTP 提取

任何套餐都可以用一次 GET 读取最新邮件,再用一个简短的正则表达式取出验证码(见下方示例)。Core 及以上套餐可使用 POST /extract-otp,它会等待邮件并只返回验证码。

IMAP

Eco+

接入您现有的邮件客户端和工具链。

自定义域名

使用您自己的域名 — 含 DNS 配置支持。

MCP 服务器

面向 Claude Desktop 和 Cursor 的即插即用工具。

CLI

即将推出。在正式发布前,请使用 REST API 或 MCP 服务器。

SDKs

提供 Python、Go 和 Rust 客户端库,也可从任何语言直接发送 HTTP 请求。

真实代码,而非伪代码

在 Playwright 测试中等待 OTP

import { test, expect } from "@playwright/test";

const API = "https://api.cybertemp.xyz";
const headers = { "X-API-KEY": process.env.CYBERTEMP_API_KEY! };

// Polls /getMail until the newest message contains a 4-8 digit code.
async function waitForOtp(email: string, timeoutMs = 30_000) {
  const deadline = Date.now() + timeoutMs;
  while (Date.now() < deadline) {
    const res = await fetch(`${API}/getMail?email=${encodeURIComponent(email)}`, { headers });
    if (!res.ok) throw new Error(`CyberTemp API returned ${res.status}: ${await res.text()}`);
    const mails: { subject: string; text: string }[] = await res.json();
    const otp = mails[0] && `${mails[0].subject}\n${mails[0].text}`.match(/\b\d{4,8}\b/);
    if (otp) return otp[0];
    await new Promise((r) => setTimeout(r, 2000));
  }
  throw new Error("Timed out waiting for the OTP email");
}

test("signup verifies via OTP", async ({ page }) => {
  const email = `e2e${Date.now()}@cybertemp.xyz`;
  await page.goto("https://example.com/signup");
  await page.fill("#email", email);
  await page.click("button[type=submit]");

  const otp = await waitForOtp(email);
  await page.fill("#otp", otp);
  await expect(page).toHaveURL(/dashboard/);
});

Webhook 接收端(Elite 与 Team 套餐)

订阅一个 HTTPS 端点,每当有邮件进入您的收件箱时,就会收到带 HMAC-SHA256 签名的 POST 请求。每次推送只尝试一次(10 秒超时),失败不会重试,因此也请不时调用 GET /getMail,以补上错过的邮件。

事件类型
  • message.received — 您的某个收件箱收到新邮件
  • test_ping — 由面板中的“测试”按钮触发
我们设置的请求头
  • X-Cybertemp-Signature: sha256=<hmac_hex>
  • X-Cybertemp-Event: message.received
  • X-Cybertemp-Delivery: <unique_id>
  • Content-Type: application/json
  • User-Agent: Cybertemp-Webhook/1.0
负载结构
{
  "id": "7c4f...",
  "type": "message.received",
  "timestamp": "2026-05-17T09:31:00.000Z",
  "data": {
    "inbox_id": "[email protected]",
    "inbox_address": "[email protected]",
    "message_id": "9a1b...",
    "from": "[email protected]",
    "to": "[email protected]",
    "subject": "Your verification code",
    "snippet": "Your code is...",
    "received_at": "2026-05-17T09:31:00.000Z"
  }
}
验证签名
import crypto from "node:crypto";
import express from "express";

const app = express();
// IMPORTANT: keep the raw buffer for HMAC. Express's json() throws it away.
app.use("/webhooks/cybertemp",
  express.raw({ type: "application/json" }));

app.post("/webhooks/cybertemp", (req, res) => {
  const header = req.header("x-cybertemp-signature") || "";
  const expected = "sha256=" + crypto
    .createHmac("sha256", process.env.CT_WEBHOOK_SECRET)
    .update(req.body)         // req.body is a Buffer thanks to express.raw
    .digest("hex");

  // timingSafeEqual throws on a length mismatch, so check the length first
  // (a missing or truncated header must be a 401, not a 500).
  const a = Buffer.from(header);
  const b = Buffer.from(expected);
  if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) {
    return res.status(401).end();
  }

  const event = JSON.parse(req.body.toString("utf8"));
  console.log(event.data.from, "→", event.data.subject);
  res.status(200).end();
});

管理端点和签名密钥,请前往 设置 → Webhook. 每个端点都有一个“测试”按钮,可发送测试事件,让您无需等待真实邮件即可检查签名验证。

通过 MCP 的智能体流程

User: Sign me up at acme.test with a throwaway email.
Wait for the verification code and paste it back.

Agent:
- create_inbox()                      -> [email protected]
- POST acme.test/signup { email: [email protected] }
- wait_for_message([email protected], timeout=60)
                                      -> "Your code is 482917"
- POST acme.test/verify { otp: 482917 }
Done.

MCP 服务器

三步快速上手

第 1 步

注册

创建免费账户。无需信用卡。

注册
第 2 步

获取 API 密钥

任何账户都可以在“设置 → API 密钥”中创建密钥。免费密钥适用免费版限制;付费套餐会提高这些限制。

获取 API 密钥
第 3 步

发起请求

curl -H "X-API-KEY: tk_..." \
  "https://api.cybertemp.xyz/[email protected]"
阅读 API 文档

仅需 €1.99/月起

使用 API 密钥免费开始。付费套餐会提高速率限制和收件箱上限;Elite 增加 Webhook。