Documentation

Universal Monetization Protocol

The payment rail for the autonomous agent economy. UMP lets AI agents transact with each other — metering usage, enforcing pricing rules, settling payments, and maintaining full audit trails.

🔴 v2.0.0-alpha.1 · API Base: https://api.umpledger.com/ump/v2
Quickstart
Make your first API call in under 5 minutes
🧠
Concepts
Understand agents, wallets, contracts, and the transaction lifecycle
📡
API Reference
Full endpoint docs with request/response examples
📦
SDK Reference
Use @umpledger/sdk in your TypeScript/Node project

What is UMP?

When AI agents work together — one agent calls another for data, computation, or services — they need a way to exchange value automatically without human intervention. UMP provides the infrastructure for this: identity, wallets, pricing rules, metering, settlement, and audit trails.

Think of UMP as Stripe for agent-to-agent transactions, but designed from the ground up for autonomous systems operating at machine speed.

Core Concepts

🤖 Agent Identity 💳 Wallets 📄 Contracts 📊 Metering 💰 Pricing Rules ⚖️ Settlement 🔍 Audit Trail 🚨 Disputes

Base URL

text
https://api.umpledger.com/ump/v2

Authentication

All API requests (except GET /health) require an API key in the request header:

bash
X-API-Key: your_api_key_here

Get your API key at umpledger.com/keys.

Getting Started

Quickstart

Get an agent transacting in under 5 minutes. This guide walks through creating two agents, funding one, and executing a transaction between them.

ℹ️
You need an API key to follow this guide. Get one here →
1

Create two agents

One agent will be the payer, the other the payee.

bash
# Create the payer agent
curl -X POST https://api.umpledger.com/ump/v2/agents \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Research Agent",
    "type": "AI_AGENT",
    "capabilities": ["data.fetch", "analysis"],
    "authority": {
      "max_per_transaction": 100,
      "max_per_day": 1000
    }
  }'

# Response: { "agent_id": "agent_abc123", "wallet_id": "wal_xyz789", ... }
bash
# Create the payee (service provider) agent
curl -X POST https://api.umpledger.com/ump/v2/agents \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Data Provider Agent",
    "type": "AI_AGENT",
    "capabilities": ["data.serve"]
  }'

# Response: { "agent_id": "agent_def456", "wallet_id": "wal_uvw321", ... }
2

Fund the payer's wallet

bash
curl -X POST https://api.umpledger.com/ump/v2/wallets/wal_xyz789/fund \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500,
    "source": "stripe_pm_abc",
    "value_unit_type": "USD_CENTS"
  }'

# Response: { "entry_id": "lge_...", "balance_after": 500 }
3

Execute a transaction

Use the high-level /transact endpoint to meter, rate, and settle in one call.

bash
curl -X POST https://api.umpledger.com/ump/v2/transact \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "agent_abc123",
    "to": "agent_def456",
    "service": "data.fetch",
    "payload": { "query": "market data Q1 2026", "tokens": 1200 },
    "max_cost": 50
  }'
json
{
  "transaction_id": "txn_a1b2c3d4",
  "cost": 24,
  "currency": "USD_CENTS",
  "outcome": "SETTLED",
  "audit_id": "aud_e5f6g7h8",
  "settled_at": "2026-03-08T09:33:24.915Z",
  "duration_ms": 42
}
4

Check the balance

bash
curl https://api.umpledger.com/ump/v2/wallets/wal_xyz789/balance \
  -H "X-API-Key: YOUR_KEY"

# { "wallet_id": "wal_xyz789", "balances": [{ "available": 476, ... }] }
💡
For production use, create a Contract between agents first to set pricing rules explicitly. See the Contracts reference →
Getting Started

Concepts

Understanding the UMP model before you build will save a lot of time. Here's how the pieces fit together.

Agent Identity

Every participant in the UMP network is an Agent — an AI model, a microservice, a bot, or even a human-facing application. Agents have:

  • Agent ID — globally unique identifier (agent_*)
  • TypeAI_AGENT, HUMAN_DELEGATE, or SYSTEM
  • Capabilities — what services the agent can provide or consume
  • Authority Scope — spending limits enforced by the protocol
  • Parent/Child hierarchy — agents can spawn sub-agents with restricted authority

Wallets

Every agent automatically gets a Wallet when created. Wallets hold balances in multiple value unit types (USD, tokens, credits). Key operations:

  • Fund — top up from an external payment source
  • Debit/Credit — happens automatically during settlement
  • Freeze/Unfreeze — emergency controls
  • Ledger — immutable record of every balance change

Contracts

A Contract governs how two agents transact. It defines pricing rules, validity periods, and negotiation terms. Contracts can be:

  • FIXED — one party sets terms, other accepts
  • DYNAMIC — back-and-forth negotiation (propose → counter → accept)
  • SPOT — no contract, use default rates

The Transaction Lifecycle

A UMP transaction goes through four stages:

text
METER → RATE → SETTLE → AUDIT

1. METER    Record a usage event (what happened, how much)
2. RATE     Apply pricing rules from the contract to get a cost
3. SETTLE   Debit payer wallet, credit payee wallet atomically
4. AUDIT    Write immutable record to the audit trail

The POST /transact endpoint runs all four stages in one call. For advanced use cases, you can call each stage individually.

Pricing Rules

Pricing rules define how usage is billed. Supported models:

  • PER_UNIT — fixed price per unit (e.g., $0.01 per token)
  • TIERED — price breaks at volume thresholds
  • PERCENTAGE — take a % of a declared value
  • FLAT_FEE — fixed fee per call regardless of usage

Authority Scopes

⚠️
Transactions that exceed an agent's authority scope are automatically rejected before settlement. Always set max_per_transaction to prevent runaway spending.
Getting Started

Authentication

All UMP API requests are authenticated with an API key passed as a request header.

API Key Header

bash
curl https://api.umpledger.com/ump/v2/agents \
  -H "X-API-Key: ump_live_your_key_here"

Unauthenticated response

json
{
  "error": "AUTHENTICATION_REQUIRED",
  "message": "Missing X-API-Key header. Get your key at https://umpledger.com/keys",
  "docs": "https://umpledger.com/keys"
}

Rate Limits

The API allows 1,000 requests per minute per API key. Rate limit headers are returned on every response:

text
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 987
X-RateLimit-Reset: 1709891234

Public endpoints

The following endpoint does not require authentication:

  • GET /health — server health check
API Reference

Agents

Agents are the primary actors in the UMP network. Every agent has an identity, capabilities, spending limits, and an associated wallet.

POST /agents Create a new agent

Creates a new Agent Identity and automatically provisions a wallet for it.

Request body

ParameterTypeRequiredDescription
namestringrequiredHuman-readable display name
typestringoptionalAI_AGENT (default), HUMAN_DELEGATE, SYSTEM
parent_idstringoptionalAgent ID of parent for hierarchy
capabilitiesstring[]optionalService identifiers this agent can provide/consume
authority.max_per_transactionnumberoptionalMax spend per single transaction
authority.max_per_daynumberoptionalDaily spending cap
authority.max_per_monthnumberoptionalMonthly spending cap
bash
curl -X POST https://api.umpledger.com/ump/v2/agents \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Research Agent",
    "type": "AI_AGENT",
    "capabilities": ["data.fetch", "analysis.run"],
    "authority": {
      "max_per_transaction": 100,
      "max_per_day": 5000,
      "max_per_month": 50000
    }
  }'
json — 201 Created
{
  "agent_id": "agent_a1b2c3d4",
  "agent_type": "AI_AGENT",
  "display_name": "Research Agent",
  "parent_id": null,
  "capabilities": ["data.fetch", "analysis.run"],
  "authority_scope": {
    "max_per_transaction": 100,
    "max_per_day": 5000,
    "max_per_month": 50000,
    "allowed_services": null,
    "allowed_counterparties": null
  },
  "wallet_id": "wal_e5f6g7h8",
  "status": "ACTIVE",
  "created_at": "2026-03-08T09:33:24.915Z"
}
GET /agents/:id Get agent details

Retrieve full details for an agent including its current wallet balance.

bash
curl https://api.umpledger.com/ump/v2/agents/agent_a1b2c3d4 \
  -H "X-API-Key: YOUR_KEY"
GET /agents List agents

Query parameters

ParameterTypeDescription
parent_idstringFilter by parent agent
typestringFilter by agent type
statusstringACTIVE, REVOKED
bash
curl "https://api.umpledger.com/ump/v2/agents?status=ACTIVE" \
  -H "X-API-Key: YOUR_KEY"
PATCH /agents/:id/authority Update spending limits
bash
curl -X PATCH https://api.umpledger.com/ump/v2/agents/agent_a1b2c3d4/authority \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "max_per_transaction": 250, "max_per_day": 10000 }'
POST /agents/:id/verify Verify agent identity

Verify that an agent is valid, active, and authorized to transact.

bash
curl -X POST https://api.umpledger.com/ump/v2/agents/agent_a1b2c3d4/verify \
  -H "X-API-Key: YOUR_KEY"
json
{ "agent_id": "agent_a1b2c3d4", "valid": true, "reason": null, "verified_at": "2026-03-08T..." }
DELETE /agents/:id Revoke agent
⚠️
Revoking an agent cascades to all child agents. This action cannot be undone.
bash
curl -X DELETE https://api.umpledger.com/ump/v2/agents/agent_a1b2c3d4 \
  -H "X-API-Key: YOUR_KEY"
json
{ "revoked_agents": ["agent_a1b2c3d4", "agent_child1"], "count": 2 }
API Reference

Wallets

Every agent has a wallet. Wallets hold balances, track every transaction in a ledger, and can be frozen for emergency control.

POST /wallets/:id/fund Fund a wallet
ParameterTypeRequiredDescription
amountnumberrequiredAmount to add
sourcestringrequiredPayment source reference (e.g. Stripe payment method ID)
value_unit_typestringoptionalUSD_CENTS (default), TOKENS, CREDITS
bash
curl -X POST https://api.umpledger.com/ump/v2/wallets/wal_e5f6g7h8/fund \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 10000, "source": "stripe_pm_abc123", "value_unit_type": "USD_CENTS" }'
GET /wallets/:id/balance Get real-time balance
bash
curl https://api.umpledger.com/ump/v2/wallets/wal_e5f6g7h8/balance \
  -H "X-API-Key: YOUR_KEY"
json
{
  "wallet_id": "wal_e5f6g7h8",
  "frozen": false,
  "balances": [{
    "value_unit_type": "USD_CENTS",
    "currency": "USD",
    "amount": 10000,
    "reserved": 0,
    "available": 10000
  }]
}
GET /wallets/:id/ledger Get spending ledger
ParameterTypeDescription
limitnumberMax entries to return (default 50)
offsetnumberPagination offset (default 0)
POST /wallets/:id/transfer Transfer to another wallet
ParameterTypeRequiredDescription
target_agent_idstringrequiredRecipient agent ID
amountnumberrequiredAmount to transfer
POST /wallets/:id/freeze Emergency freeze

Immediately blocks all transactions. Use POST /wallets/:id/unfreeze to restore.

API Reference

Transactions

Execute value transfers between agents. Use the high-level /transact endpoint for most cases, or call each pipeline stage individually for advanced control.

POST /transact Execute a full transaction

Runs the full pipeline — meter → rate → settle → audit — in a single call. Recommended for most use cases.

ParameterTypeRequiredDescription
fromstringrequiredPayer agent ID
tostringrequiredPayee agent ID
servicestringrequiredService identifier (e.g. data.fetch)
payloadobjectoptionalService-specific metadata (tokens, bytes, etc.)
max_costnumberoptionalCost ceiling — transaction aborts if exceeded
bash
curl -X POST https://api.umpledger.com/ump/v2/transact \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "agent_a1b2c3d4",
    "to": "agent_e5f6g7h8",
    "service": "data.fetch",
    "payload": { "tokens": 1200 },
    "max_cost": 50
  }'
json — 201 Created
{
  "transaction_id": "txn_a1b2c3d4",
  "cost": 24,
  "currency": "USD_CENTS",
  "outcome": "SETTLED",
  "audit_id": "aud_e5f6g7h8",
  "settled_at": "2026-03-08T09:33:24.915Z",
  "duration_ms": 42
}
POST /usage-events Submit raw usage events

Record metering events without immediately settling. Use this when you need to batch events before rating.

bash
curl -X POST https://api.umpledger.com/ump/v2/usage-events \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "source_agent_id": "agent_a1b2c3d4",
      "target_agent_id": "agent_e5f6g7h8",
      "service_id": "llm.inference",
      "quantity": 4200,
      "unit": "tokens",
      "contract_id": "ctr_xyz"
    }
  ]'
GET /transactions/:id Get transaction details
bash
curl https://api.umpledger.com/ump/v2/transactions/txn_a1b2c3d4 \
  -H "X-API-Key: YOUR_KEY"
API Reference

Contracts

Contracts define the pricing rules between two agents. Without a contract, UMP uses default spot rates. With a contract, you get explicit pricing, validity windows, and negotiation flows.

POST /contracts Create a contract
ParameterTypeRequiredDescription
source_agent_idstringrequiredProposing agent
target_agent_idstringrequiredCounterparty agent
modestringrequiredFIXED, DYNAMIC, or SPOT
pricing_rulesobject[]requiredArray of pricing rule objects
effective_fromISO dateoptionalContract start date
effective_untilISO dateoptionalContract expiry date
bash
curl -X POST https://api.umpledger.com/ump/v2/contracts \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source_agent_id": "agent_a1b2c3d4",
    "target_agent_id": "agent_e5f6g7h8",
    "mode": "FIXED",
    "pricing_rules": [{
      "service_id": "data.fetch",
      "model": "PER_UNIT",
      "unit": "tokens",
      "price_per_unit": 0.02,
      "currency": "USD_CENTS"
    }],
    "effective_until": "2027-01-01T00:00:00Z"
  }'
POST /contracts/negotiate Start dynamic negotiation

Creates a DYNAMIC contract proposal. The counterparty can then accept or counter-propose via /contracts/:id/accept or /contracts/:id/counter.

GET /contracts/:id Get contract details
bash
curl https://api.umpledger.com/ump/v2/contracts/ctr_xyz \
  -H "X-API-Key: YOUR_KEY"
DELETE /contracts/:id Terminate a contract

Terminates the contract immediately. Existing settled transactions are unaffected.

API Reference

Audit Trail

Every transaction automatically creates an immutable audit record. Query audit logs for compliance, debugging, and dispute resolution.

GET /audit/:id Get audit record
bash
curl https://api.umpledger.com/ump/v2/audit/aud_e5f6g7h8 \
  -H "X-API-Key: YOUR_KEY"
json
{
  "audit_id": "aud_e5f6g7h8",
  "transaction_id": "txn_a1b2c3d4",
  "from_agent": "agent_a1b2c3d4",
  "to_agent": "agent_e5f6g7h8",
  "service": "data.fetch",
  "amount": 24,
  "currency": "USD_CENTS",
  "outcome": "SETTLED",
  "timestamp": "2026-03-08T09:33:24.915Z",
  "immutable": true
}
GET /audit List audit records
ParameterTypeDescription
agent_idstringFilter by agent (payer or payee)
from_dateISO dateStart of date range
to_dateISO dateEnd of date range
limitnumberMax records (default 50)
SDK Reference

SDK Installation

The @umpledger/sdk package lets you embed UMP directly in your Node.js or TypeScript application — no HTTP calls needed.

Install

bash
npm install @umpledger/sdk

Initialize

typescript
import { UMP } from '@umpledger/sdk';

const ump = new UMP({
  // Optional config — defaults work for alpha
});
ℹ️
In the alpha, UMP runs in-process with in-memory state. Production releases will connect to api.umpledger.com automatically.

Requirements

  • Node.js 18+
  • TypeScript 5+ (optional but recommended)
SDK Reference

SDK — Agents

Manage agent identities programmatically using the SDK.

typescript
import { UMP } from '@umpledger/sdk';
const ump = new UMP();

// Create an agent
const agent = ump.agents.create({
  name: 'Research Agent',
  type: 'AI_AGENT',
  capabilities: ['data.fetch'],
  authority: {
    maxPerTransaction: 100,
    maxPerDay: 5000,
  },
});

console.log(agent.agentId); // "agent_a1b2c3d4"

// Get an agent
const found = ump.agents.get('agent_a1b2c3d4');

// List agents
const allAgents = ump.agents.list({ status: 'ACTIVE' });

// Update authority
const updated = ump.agents.updateAuthority('agent_a1b2c3d4', {
  maxPerTransaction: 250,
});

// Verify an agent
const result = ump.agents.verify('agent_a1b2c3d4');
console.log(result.valid); // true

// Revoke (cascades to children)
const revoked = ump.agents.revoke('agent_a1b2c3d4');
SDK Reference

SDK — Wallets

typescript
import { UMP } from '@umpledger/sdk';
const ump = new UMP();

// Fund a wallet
const entry = ump.wallets.fund('wal_xyz', {
  amount: 10000,
  source: 'stripe_pm_abc',
  valueUnitType: 'USD_CENTS',
});

// Get balance
const balances = ump.wallets.getBalance('wal_xyz');
console.log(balances[0].available); // 10000

// Get ledger entries
const ledger = ump.wallets.getLedger('wal_xyz', 50, 0);

// Get wallet by agent
const wallet = ump.wallets.getByAgent('agent_abc');

// Freeze / Unfreeze
ump.wallets.freeze('wal_xyz');
ump.wallets.unfreeze('wal_xyz');

// Transfer between agents
ump.wallets.debit('wal_from', 100, 'agent_to', 'txn_ref');
ump.wallets.credit('wal_to', 100, 'agent_from', 'txn_ref');
SDK Reference

SDK — Transactions

typescript
import { UMP } from '@umpledger/sdk';
const ump = new UMP();

// High-level: meter + rate + settle in one call
const result = await ump.transact({
  from: 'agent_a1b2c3d4',
  to: 'agent_e5f6g7h8',
  service: 'data.fetch',
  payload: { tokens: 1200 },
  maxCost: 50,
});

console.log(result.transactionId); // "txn_..."
console.log(result.cost);          // 24
console.log(result.outcome);       // "SETTLED"

// Low-level: record usage event
const event = ump.metering.record({
  sourceAgentId: 'agent_a1b2c3d4',
  targetAgentId: 'agent_e5f6g7h8',
  serviceId: 'data.fetch',
  quantity: 1200,
  unit: 'tokens',
});

// Rate against a pricing rule
const ratingResult = ump.pricing.rate(rule, event);
SDK Reference

SDK — Contracts

typescript
import { UMP } from '@umpledger/sdk';
const ump = new UMP();

// Create a fixed contract
const contract = ump.contracts.create('agent_a1b2c3d4', {
  targetAgentId: 'agent_e5f6g7h8',
  mode: 'FIXED',
  pricingRules: [{
    serviceId: 'data.fetch',
    model: 'PER_UNIT',
    unit: 'tokens',
    pricePerUnit: 0.02,
    currency: 'USD_CENTS',
  }],
  effectiveUntil: new Date('2027-01-01'),
});

// Get a contract
const found = ump.contracts.get('ctr_xyz');

// Start negotiation
const proposal = ump.contracts.propose('agent_a1b2c3d4', {
  targetAgentId: 'agent_e5f6g7h8',
  pricingRules: [...],
});

// Accept / counter
ump.contracts.accept('ctr_xyz', 'agent_e5f6g7h8');
ump.contracts.counter('ctr_xyz', 'agent_e5f6g7h8', { pricingRules: [...] });

// Terminate
ump.contracts.terminate('ctr_xyz');
Resources

Error Reference

UMP API errors always return a JSON body with error and message fields.

Error CodeHTTPDescription
AUTHENTICATION_REQUIRED401Missing or invalid API key
AGENT_NOT_FOUND404Agent ID does not exist
WALLET_NOT_FOUND404Wallet ID does not exist
INSUFFICIENT_FUNDS402Wallet balance too low for transaction
AUTHORITY_EXCEEDED403Transaction exceeds agent's spending limit
WALLET_FROZEN403Wallet is frozen — all transactions blocked
CONTRACT_NOT_FOUND404Contract ID does not exist
CONTRACT_EXPIRED410Contract is past its effective_until date
MAX_COST_EXCEEDED402Transaction cost exceeded the max_cost ceiling
RATE_LIMIT_EXCEEDED429Too many requests — 1000/minute limit reached
VALIDATION_ERROR400Request body failed schema validation
INTERNAL_ERROR500Unexpected server error

Error response format

json
{
  "error": "INSUFFICIENT_FUNDS",
  "message": "Wallet wal_xyz has insufficient balance. Available: 10, Required: 50",
  "docs": "https://docs.umpledger.com"
}
Resources

Changelog

v2.0.0-alpha.1 — March 2026

Initial public alpha release.

  • Agent identity management (create, list, verify, revoke)
  • Wallet system with fund, balance, ledger, freeze/unfreeze, transfer
  • Full transaction pipeline: /transact, /usage-events, /rate, /settle
  • Contract management with fixed, dynamic, and spot modes
  • Immutable audit trail
  • Dispute submission and tracking
  • @umpledger/sdk npm package
  • Live API at api.umpledger.com