Home / Home / Tutorials / Integrate sipi.bot with the Vercel AI SDK

Integrate sipi.bot with the Vercel AI SDK

The AI SDK makes streaming AI features easy — and easy features get agents that spend. The guard slots into the same flow.

Step 1 — Add the guard call

In the tool or action that spends, call the evaluate endpoint before the purchase.

Step 2 — Branch on the decision

APPROVED → proceed. BLOCKED → return the reason to the model. FLAGGED → route to an approval step.

Step 3 — Start with three rules

A per-transaction cap, a merchant allowlist, and a velocity limit.

Guard call

const res = await fetch("https://sipi.bot/v1/transactions/evaluate", {
  method: "POST",
  headers: { "Content-Type": "application/json", "Authorization": `Bearer ${key}` },
  body: JSON.stringify({ amount: 120, merchant: "api.vendor.com", category: "api" }),
});
const { decision } = await res.json(); // APPROVED | BLOCKED | FLAGGED

Deterministic, ~5 ms, no model call.

FAQ

Does this work in edge runtimes?

Yes — it's a plain fetch to an HTTPS endpoint.

Is there a wrapper?

A thin client wrapper exists for the AI SDK; the fetch above is the whole integration.

Related

Stop the next $12,400 night.

One API call (or MCP tool) in front of every agent transaction — APPROVED, BLOCKED, or FLAGGED, deterministic, ~5 ms, fully logged.

See plans — from $99/mo Try a live check