Skip to main content

Agentic Payments

Enable AI agents to make payments autonomously with scoped permissions, spending limits, and complete audit trails.

What is the Agentic Intent Protocol?

The Agentic Intent Protocol (AIP) is ZendFi's framework for enabling AI agents to handle payments on behalf of users. It provides:

  • Scoped API keys with limited permissions
  • Spending limits per transaction, per day, per week, and per month
  • Time-bound sessions that auto-expire
  • Device-bound session keys for non-custodial signing
  • Autonomous delegates for hands-free operation
  • PKP session identity (optional on-chain audit trail via Lit Protocol)
  • PPP pricing for global reach
  • Complete audit trails for compliance

Quick Start

import { zendfi } from '@zendfi/sdk';

// 1. Create an agent key (requires agent_id)
const agentKey = await zendfi.agent.createKey({
name: 'Shopping Assistant',
agent_id: 'shopping-assistant-v1',
scopes: ['create_payments'],
});

console.log('Save this key:', agentKey.full_key); // zai_test_...

// 2. Create a session with spending limits
const session = await zendfi.agent.createSession({
agent_id: 'shopping-assistant-v1',
user_wallet: 'Hx7B...abc',
limits: {
max_per_transaction: 50,
max_per_day: 200,
},
duration_hours: 24,
});

// 3. Make payments within limits
const payment = await zendfi.agent.pay({
session_token: session.session_token,
amount: 25.00,
description: 'Widget purchase',
});

console.log('Payment confirmed:', payment.transaction_signature);

// Or use Payment Intents for two-phase flow
const intent = await zendfi.intents.create({
amount: 25.00,
description: 'Coffee purchase',
});

// 4. Confirm when customer is ready to pay
const confirmed = await zendfi.intents.confirm(intent.id, {
client_secret: intent.client_secret,
customer_wallet: 'Hx7B...abc',
});

Core Concepts

ConceptDescriptionLearn More
Agent KeysScoped API keys for AI agentsAgent Keys →
SessionsTime-bound spending limitsSessions →
Session KeysPre-funded wallets for autonomous agentsSession Keys →
Payment IntentsTwo-phase commit for reliable paymentsPayment Intents →
PPP PricingPurchasing power parity for global marketsPPP Pricing →
Autonomous DelegationUser-granted spending authorityDelegation →
Smart PaymentsAI-optimized payment executionSmart Payments →
Device-Bound KeysHardware-secured signing keysDevice Keys →
SecurityBest practices and controlsSecurity →

Architecture

┌─────────────────────────────────────────────────────────────┐
│ Your AI Agent │
├─────────────────────────────────────────────────────────────┤
│ ZendFi SDK │
├───────────────┬───────────────┬───────────────┬─────────────┤
│ Agent Keys │ Sessions │ Session Keys │ Smart │
│ (Scoped) │ (Limits) │ (Pre-funded) │ Payments │
├───────────────┴───────────────┴───────────────┴─────────────┤
│ ZendFi Platform │
├─────────────────────────────────────────────────────────────┤
│ Solana │ Lit Protocol │ Webhooks │ Analytics │
└─────────────────────────────────────────────────────────────┘

Features at a Glance

Spending Controls

  • Per-transaction limits
  • Daily, weekly, monthly caps
  • Merchant whitelists/blacklists
  • Category restrictions
  • Time-based restrictions

Security

  • Device-bound keys (WebAuthn/TPM)
  • MPC distributed signing (Lit Protocol)
  • Complete audit trails
  • Webhook signature verification
  • IP whitelisting

Optimization

  • Smart routing
  • Gas abstraction
  • Batch payments
  • PPP pricing
  • Cross-chain support

Use Cases

Shopping Agents

// Agent shops within user's budget
const session = await zendfi.agent.createSession({
agent_id: 'shopping-bot',
limits: { max_per_transaction: 100, max_per_day: 500 },
});

Subscription Management

// Agent manages recurring payments
const intent = await zendfi.intents.create({
amount: 9.99,
description: 'Monthly subscription',
});

Autonomous Trading

// Agent executes trades within parameters
const delegation = await zendfi.agent.createDelegation({
limits: { max_per_transaction: 1000 },
allowed_categories: ['trading'],
});

Next Steps

Getting Started

Advanced Features


CLI Quick Reference

# Agent Keys
zendfi agent keys create --name "My Agent"
zendfi agent keys list
zendfi agent keys revoke <key-id>

# Agent Sessions
zendfi agent sessions create --agent-id my-agent --wallet Hx7B...
zendfi agent sessions list

# Payment Intents
zendfi intents create --amount 99.99
zendfi intents confirm <intent-id> --wallet Hx7B...

# PPP Pricing
zendfi ppp check BR
zendfi ppp calculate --price 99.99 --country IN

# Smart Payments
zendfi smart pay --to <wallet> --amount 99.99

Resources

Ask AI about the docs...