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.
https://api.usesendra.com/v1Overview
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).
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.
Path to TEE wallets
| Today | Tomorrow |
|---|---|
| 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
- Owner must prefer Stellar passkey (
preferred_stellar_wallet=passkey) with funds. - Intent creates a
pending_transactionsrow and WhatsApp CTA (or utility template / open-chat). - Owner opens confirm URL → biometric → gasless Stellar send.
- Agent sees
completedwithresult.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/checkoutwith phone → WhatsApp passkey → poll → unlock - Agent:
POST /v1/intents/x402with the quote → approve →?intent_id=orPOST …/unlock
UI walkthrough: From Web2 to Web3.
Intent statuses
| Status | What to do |
|---|---|
awaiting_approval | Poll; owner has the CTA |
needs_user_open_chat | Owner opens WA → /notify |
processing | Autonomous in flight |
forwarding / forwarding_failed | Fee hop; keep polling |
completed | Use tx hash / unlock resource |
failed / cancelled / expired | Stop 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-Keyon money moves. - Tier 0 chain: Stellar only (Aptos/Arc wallets exist for humans; agent spends expand later).