Human-in-the-loop API and SDK

Human-in-the-loop for your AI agent's users.

When your agent hits a step that needs a person, Pushary asks them on their phone and waits for the answer, fail-closed.

@pushary/server · @pushary/ai-sdk · @pushary/eve · pip install pushary

What is a human-in-the-loop API?

A human-in-the-loop API lets an AI agent pause mid-run and wait for a person to decide. Pushary is a managed one: enroll(externalId) connects a user's phone in one tap, decisions.ask() blocks until they approve, deny, or answer, and the call fails closed if nobody responds. Every decision is written to a durable ledger.

New to the pattern? Human-in-the-loop for AI agents, explained covers what it means and where the checkpoints sit.

The integration

Two calls, and your agent can ask a human

Connect a user's phone once, then ask a human where it matters. Your users tap once to connect, with no account, no app, and no key on their side.

npm i @pushary/servertwo calls
import { createPusharyServer } from "@pushary/server"

const px = createPusharyServer({ apiKey: process.env.PUSHARY_API_KEY! })

// Connect an end-user's phone once. Keyless, one tap, no app to install.
await px.enroll(user.id)

// Ask a real human. Blocks until they decide. Fail-closed on timeout.
const decision = await px.decisions.ask({
  externalId: user.id,
  type: "confirm",
  question: "Approve a $480 refund to customer #4471?",
})

if (decision.approved) await issueRefund()

How it works

From ask to resume

Connect the phone once, ask a human at the step that guards a risky action, and act on the decision. The waiting, the delivery, and the record are handled for you.

  1. 01

    Connect the phone that approves

    Call enroll(externalId) with your own id for the user. They tap a one-tap link once to connect their phone. No account, no app, no key on their side.

  2. 02

    Install the SDK

    Use @pushary/server in TypeScript or pip install pushary in Python. On the Vercel AI SDK and Eve, use the @pushary/ai-sdk and @pushary/eve adapters.

  3. 03

    Ask a human where it matters

    Call decisions.ask inside the tool or step that guards the risky action. It sends the question to the person's phone and blocks until they answer.

  4. 04

    Act on the fail-closed decision

    If nobody answers in your window, the decision comes back denied, so a timeout never turns into an unapproved action. Every answer is written to a durable ledger.

A decision is a yes or no confirm, a multiple-choice select, or a free-text input. Every one is stored with its outcome and kept in the audit log.

FAQ

Questions, answered

What is a human-in-the-loop API?
A human-in-the-loop API lets an AI agent pause mid-run and wait for a person to decide. Pushary is a managed one: enroll(externalId) connects a user's phone in one tap, decisions.ask() blocks until they approve, deny, or answer, and the call fails closed if nobody responds. Every decision is written to a durable ledger.
How do I add human-in-the-loop to an AI agent I already built?
Install @pushary/server in TypeScript or pip install pushary in Python, then add two calls. enroll(externalId) connects the phone of the person who approves. decisions.ask() goes inside the tool or step that guards the risky action, and blocks until they answer. Nothing about your agent's control flow has to change, and there are published adapters for the Vercel AI SDK and Eve.
What is human-in-the-loop for AI agents?
Human-in-the-loop for AI agents means pausing the agent at a risky step and letting a real person approve, deny, or answer before it continues. Pushary is the managed layer that does it, built so your agent can ask its own end-users. One tool call sends the question to a person's phone, blocks until they decide, fails closed if nobody answers in your window, and writes the outcome to a durable decisions ledger.
How can my agent ask my own users instead of just me?
You reference each user by your own externalId. Call enroll(externalId) to connect their phone with a one-tap link, then call decisions.ask with the same externalId. The approval lands with that specific person, so a product with thousands of users can ask each of them about their own decision.
What happens if nobody answers?
The decision fails closed. If nobody answers in the window you set, it comes back denied, and you choose what to do. Because the wait is backed by a durable ledger, a restart does not lose the request.
Do my end-users need an account or app?
No. One tap connects their phone. Delivery uses native app push when they have it, PWA push notifications otherwise, and Slack if you route it there. They never see a Pushary login or bill.
Which frameworks does Pushary support?
The Vercel AI SDK and Eve have published adapters (@pushary/ai-sdk and @pushary/eve). LangGraph, LangChain, CrewAI, Mastra, the OpenAI Agents SDK, Hermes, and OpenClaw use @pushary/server in TypeScript or pip install pushary in Python. There is also a hosted MCP server for the Claude Agent SDK and any MCP client.
How much does it cost?
The Partner plan is $99 a month for companies embedding human-in-the-loop for their end-users. There is a $9.99 a month Agent plan for a solo developer who wants their own agent to notify or ask them. Card details are collected at checkout.

Give your users the final say, on their phone.

Connect a user with one tap, ask a human with one call, and act on a fail-closed decision. Every decision is saved to a durable ledger you can audit.

Partner plan, $99 a month. Your users never see a Pushary login or bill.