Hackathon · Agentic payments

Agents propose.
Humans (or TEEs) settle.

Sendra’s Agent Intent API lets software request Stellar USDC payments. Production-shaped spends go through the owner’s passkey wallet over WhatsApp. Autonomous demos use a custodial demo key — the same API slot that future TEE agent wallets will fill.

API · https://api.usesendra.com/v1
Demo · Web2 → Web3 ($0.01 USDC)

Overview

An agent authenticates with a scoped key (sak_…) bound to a Sendra user’s phone. It creates an intent — send funds, or pay an x402 quote. Settlement is either owner-approved (passkey) or signed by the demo autonomous wallet (stand-in for TEE).

AI agent ──intent──► Agent Intent API │ ┌───────────────┼───────────────┐ ▼ ▼ ▼ mode=passkey mode=autonomous (future TEE) WhatsApp CTA demo custodial enclave signer + passkey Stellar key + policy └───────────► Stellar USDC ◄───┘

Wallet models

Passkey (owner-controlled)

Self-custodial Stellar wallet unlocked by WebAuthn. Agent never sees keys. Owner taps Authenticate in WhatsApp, confirms with Face ID / fingerprint, Sendra’s stellar-service submits gaslessly.

Demo custodial → TEE

Hackathon autonomous mode signs from a Sendra-operated demo wallet (not the owner’s passkey). Same mode=autonomous field later routes to a TEE-sealed agent wallet with spend policy and attestation.

Why both: passkey proves safe agent spends against real user wallets today. Custodial demo proves uninterrupted agent UX and keeps the Intent API stable for the TEE upgrade.

Path to TEE wallets

TodayTomorrow
Shared demo Stellar wallet on the wallet host Per-agent / per-user key sealed in a TEE
Sendra-operated demo signer (ops-only; not published to integrators) Key never leaves the enclave; release only under attested policy
allow_autonomous on the API key Policy: limits, allowlists, windows, human revoke
mode: "autonomous" on intents Same client field; signing backend swaps to TEE

Passkey remains the default for user-owned balances. TEE wallets are for agent-native money that can pay within policy without interrupting the owner every time.

Integrate in minutes

1. Create an agent (admin secret)

curl -sS -X POST https://api.usesendra.com/v1/agents \
  -H "Content-Type: application/json" \
  -H "X-Agents-Admin-Secret: $SENDRA_AGENTS_ADMIN_SECRET" \
  -d '{"user_phone":"2348012345678","name":"ResearchBot","allow_autonomous":true}'

Store api_key once. All agent calls use Authorization: Bearer sak_….

2. Read balances / addresses

curl -sS https://api.usesendra.com/v1/balances \
  -H "Authorization: Bearer $AGENT_API_KEY"

curl -sS https://api.usesendra.com/v1/addresses \
  -H "Authorization: Bearer $AGENT_API_KEY"

3. Propose a payment

curl -sS -X POST https://api.usesendra.com/v1/intents/send \
  -H "Authorization: Bearer $AGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: inv-42" \
  -d '{
    "amount": "1.00",
    "currency": "USDC",
    "chain": "stellar",
    "recipient": "G…",
    "purpose": "Pay supplier invoice 42",
    "mode": "passkey"
  }'

4. Poll until settled

curl -sS https://api.usesendra.com/v1/intents/$ID \
  -H "Authorization: Bearer $AGENT_API_KEY"

Full endpoint table, TypeScript sketch, fee hop, and notify flow: see the repo guide at wallet/agent-api/README.md.

Passkey approval flow

  1. Owner must prefer Stellar passkey (preferred_stellar_wallet=passkey) with funds.
  2. Intent creates a pending_transactions row and WhatsApp CTA (or utility template / open-chat).
  3. Owner opens confirm URL → biometric → gasless Stellar send.
  4. Agent sees completed with result.tx_hash.

Outside Meta’s 23h session window, status may be needs_user_open_chat. Ask the owner to message Sendra, then POST /v1/intents/{id}/notify. Accrued WA utility fees are collected on the next passkey spend via an escrow hop.

Autonomous demo

{
  "mode": "autonomous",
  "amount": "0.05",
  "currency": "USDC",
  "chain": "stellar",
  "recipient": "G…",
  "purpose": "Autonomous demo payout"
}

Requires the agent to be created with allow_autonomous: true. Signs in one round-trip — no WhatsApp. Funds come from a Sendra-operated demo wallet, not the owner’s passkey address. Signing keys stay on Sendra’s servers (never shipped to integrators); the same mode later swaps to a TEE / per-agent custodial OZ wallet without changing client code.

x402 paywall

Live resource: GET /api/demo/article → 402 until paid ($0.01 USDC on Stellar).

  • Human: POST …/article/checkout with phone → WhatsApp passkey → poll → unlock
  • Agent: POST /v1/intents/x402 with the quote → approve → ?intent_id= or POST …/unlock

UI walkthrough: From Web2 to Web3.

Intent statuses

StatusWhat to do
awaiting_approvalPoll; owner has the CTA
needs_user_open_chatOwner opens WA → /notify
processingAutonomous in flight
forwarding / forwarding_failedFee hop; keep polling
completedUse tx hash / unlock resource
failed / cancelled / expiredStop or create a new intent

Security notes

  • API keys are hashed at rest; shown once at create.
  • Agents are scoped to one owner phone.
  • Passkey mode never returns private keys to agents.
  • Autonomous mode is allowlisted + demo-wallet-only until TEE.
  • Always send Idempotency-Key on money moves.
  • Tier 0 chain: Stellar only (Aptos/Arc wallets exist for humans; agent spends expand later).