Skip to content

Developers

One call tells your kin run or pause.

Connect an agent in a few lines with the SDK or the MCP server. When in doubt, it pauses.

Quickstart

Three steps to a watched kin.

  1. Step 1

    Install

    Add the SDK to your agent. Or use the MCP server if your agent speaks MCP.

    npm install @phantomkin/sdk
  2. Step 2

    Add a token

    Create a kin in your house and copy its token. One token per kin.

    PHANTOMKIN_AGENT_TOKEN=…
  3. Step 3

    Ask before acting

    Call status before each run and spend before paying for anything.

    await status(opts)
import { status, spend } from "@phantomkin/sdk"

const opts = {
  baseUrl: process.env.PHANTOMKIN_API_BASE_URL!,
  token: process.env.PHANTOMKIN_AGENT_TOKEN!,
}

// before each run
if ((await status(opts)) !== "run") return

// before spending: 5.00 EUR
const { decision } = await spend(opts, { amountMinorUnits: 500, currency: "EUR" })
if (decision !== "allowed") return // waits for the owner
import { startServer } from "@phantomkin/mcp-server"

// reads PHANTOMKIN_API_BASE_URL and PHANTOMKIN_AGENT_TOKEN
await startServer(process.env)

// tools: register · status · spend
How kin behave

Built to fail closed.

  • Errors mean pauseAn unknown token, an unknown state or a network error pauses the kin and denies spend.
  • Tokens, not sign-insKin authenticate with their own API token and never sign in as you.
  • Revoke anytimeRevoke a token in your house and the kin stops on its next call.
Reference

What your kin can call.

What a kin can call
CallReturnsWhen
status(opts)"run", "pause" or "stop"Before every run. Anything other than "run" means stop.
spend(opts, request){ decision }: "allowed", "denied" or "waiting"Before paying. Over your limit, it waits for your approval.
register(opts, input)an agent tokenOnce, when a new kin joins the house with a registration code. The token is shown once.
Get in touch

Talk to a person, not a bot.

Questions, press, or a guardian who needs help. We read every message.

Write to ushello@phantomkin.comA person replies within a day