Documentation

Universal Monetization Protocol

Settlement orchestration for the autonomous agent economy. UMP determines who gets paid, how much, and in what order, then signals external payment rails (Stripe, Visa, ACH, stablecoins) to execute. It meters usage, enforces pricing rules, orchestrates settlement, and maintains 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 govern value exchange automatically without human intervention. UMP provides that governance layer: identity, wallets, pricing rules, metering, settlement orchestration, and audit trails.

Think of UMP as the settlement orchestration layer sitting above payment rails like Stripe or ACH — it decides who gets paid, how much, and when, then delegates the actual money movement to the rail you choose.

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",
    "agent_type": "AI_AGENT",
    "capabilities": ["data.fetch", "analysis"],
    "authority": {
      "maxPerTransaction": 100,
      "maxPerDay": 1000
    }
  }'

# Response: { "agent_id": "agent_abc123", "wallet_id": "wallet_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",
    "agent_type": "AI_AGENT",
    "capabilities": ["data.serve"]
  }'

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

Fund the payer's wallet

bash
curl -X POST https://api.umpledger.com/ump/v2/wallets/wallet_xyz789/fund \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 100,
    "currency": "USD"
  }'

# Response: { "wallet_id": "wallet_xyz789", "balance": 100, "currency": "USD", "status": "ACTIVE" }
3

Execute a transaction

Use the high-level /transact endpoint to meter, rate, and orchestrate settlement 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": 5,
  "currency": "USD",
  "outcome": "COMPLETED",
  "audit_id": "audit_e5f6g7h8",
  "settled_at": "2026-03-17T19:11:19.494Z",
  "duration_ms": 0
}
4

Check the balance

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

# { "wallet_id": "wallet_xyz789", "balance": 95, "currency": "USD", "status": "ACTIVE" }
💡
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 → ORCHESTRATE → AUDIT

1. METER       Record a usage event (what happened, how much)
2. RATE        Apply pricing rules from the contract to get a cost
3. ORCHESTRATE Determine who gets paid, how much, in what order.
               Enforce policies. Signal external rail to execute.
               (Actual money movement: Stripe / Visa / ACH / stablecoin)
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",
    "agent_type": "AI_AGENT",
    "capabilities": ["data.fetch", "analysis.run"],
    "authority": {
      "maxPerTransaction": 100,
      "maxPerDay": 5000
    }
  }'
json — 201 Created
{
  "agent_id": "agent_a1b2c3d4",
  "name": "Research Agent",
  "agent_type": "AI_AGENT",
  "capabilities": ["data.fetch", "analysis.run"],
  "authority": {
    "maxPerTransaction": 100,
    "maxPerDay": 5000
  },
  "wallet_id": "wallet_e5f6g7h8",
  "status": "ACTIVE",
  "created_at": "2026-03-17T10:00:00.000Z"
}
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 in USD
currencystringrequiredCurrency code (e.g. USD)
bash
curl -X POST https://api.umpledger.com/ump/v2/wallets/wallet_e5f6g7h8/fund \
  -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 100, "currency": "USD" }'
GET /wallets/:id/balance Get real-time balance
bash
curl https://api.umpledger.com/ump/v2/wallets/wallet_e5f6g7h8/balance \
  -H "X-API-Key: YOUR_KEY"
json
{
  "wallet_id": "wallet_e5f6g7h8",
  "balance": 100,
  "currency": "USD",
  "status": "ACTIVE"
}
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 → orchestrate → audit — in a single call. UMP computes who owes what, enforces policies, and signals the payment rail to execute. Recommended for most use cases.

ParameterTypeRequiredDescription
fromstringrequiredPayer agent ID
tostringrequiredPayee agent ID
contract_idstringrequiredContract ID governing the pricing rules
servicestringrequiredService identifier matching contract service_name
payloadobjectoptionalService-specific metadata (e.g. {"application_id": "loan_001"})
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",
    "contract_id": "contract_a1b2c3d4",
    "service": "data-fetch",
    "payload": { "application_id": "app_001" }
  }'
json — 201 Created
{
  "transaction_id": "txn_a1b2c3d4",
  "cost": 5,
  "currency": "USD",
  "outcome": "COMPLETED",
  "audit_id": "audit_e5f6g7h8",
  "settled_at": "2026-03-17T19:11:19.494Z",
  "duration_ms": 0
}
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_idstringrequiredPaying agent (payer)
target_agent_idstringrequiredReceiving agent (payee)
service_namestringrequiredService identifier (e.g. fraud-risk-check)
pricing_rulesobject[]requiredArray of pricing rule objects. Each rule: {"primitive": "FLAT_FEE", "amount": 5.00, "currency": "USD"}
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",
    "service_name": "data-fetch",
    "pricing_rules": [{
      "primitive": "FLAT_FEE",
      "amount": 5.00,
      "currency": "USD"
    }]
  }'
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": "audit_e5f6g7h8",
  "transaction_id": "txn_a1b2c3d4",
  "agent_id": "agent_a1b2c3d4",
  "operation": "TRANSACTION_SETTLED",
  "resource_type": "TRANSACTION",
  "resource_id": "txn_a1b2c3d4",
  "amount": 5,
  "currency": "USD",
  "outcome": "COMPLETED",
  "timestamp": "2026-03-17T19:11:19.494Z",
  "immutable": true
}
GET /audit List audit records
ParameterTypeDescription
agent_idstringFilter by agent ID (payer or payee)
operationstringFilter by operation type (e.g. TRANSACTION_SETTLED)
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 + orchestrate settlement 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
Integrations

Local Testing Guide

Run the UMP server locally against a live Railway PostgreSQL database. From zero to live API in 10 minutes.

⚠️
The local server connects to the live Railway PostgreSQL database. Data you create locally persists in production. Use POST /ump/v2/demo/reset to wipe all data when needed.

1. Prerequisites

Install the following on your machine:

2. Clone & Install

bash
git clone https://github.com/umpledger/ump-protocol.git
cd ump-protocol/ump-server
npm install

3. Fix TypeScript Config

Open tsconfig.json and replace its contents with:

json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "CommonJS",
    "moduleResolution": "node",
    "declaration": true,
    "outDir": "./dist",
    "noEmitOnError": false,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "resolveJsonModule": true
  },
  "include": ["src/**/*.ts"],
  "exclude": ["node_modules", "dist"]
}

4. Create .env File

bash
echo DATABASE_URL=postgresql://ump:ump_secure_2026@switchback.proxy.rlwy.net:44264/ump_db > .env
echo DATABASE_SSL=false >> .env
echo PORT=3000 >> .env

5. Start the Server

bash
npx ts-node --transpile-only -r dotenv/config src/server.ts

Expected output:

text
[db] Running migrations...
[db] Migrations complete.
{"level":30,"msg":"Server listening at http://0.0.0.0:3000"}
{"level":30,"msg":"UMP server running on port 3000 with PostgreSQL storage"}

6. Health Check

bash
curl http://localhost:3000/health
json
{"status":"ok","version":"2.0.0-alpha.1","protocol":"UMP","storage":"postgresql"}

7. Register Agents

Each agent gets an auto-created wallet. Any key starting with ump_sk_ is accepted during alpha.

bash — Credit Check Agent
curl -X POST http://localhost:3000/ump/v2/agents   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"name": "Credit Check Agent", "agent_type": "AI_AGENT",
       "capabilities": ["credit-check", "bureau-query", "score-evaluation"],
       "authority": {"maxPerTransaction": 10, "maxPerDay": 1000}}'
bash — Fraud Risk Model Agent
curl -X POST http://localhost:3000/ump/v2/agents   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"name": "Fraud Risk Model Agent", "agent_type": "AI_AGENT",
       "capabilities": ["fraud-detection", "risk-scoring", "anomaly-detection"],
       "authority": {"maxPerTransaction": 10, "maxPerDay": 1000}}'
bash — Income AI Verification Agent
curl -X POST http://localhost:3000/ump/v2/agents   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"name": "Income AI Verification Agent", "agent_type": "AI_AGENT",
       "capabilities": ["income-verification", "document-analysis", "payroll-check"],
       "authority": {"maxPerTransaction": 10, "maxPerDay": 1000}}'
bash — Loan Pricing Engine Agent
curl -X POST http://localhost:3000/ump/v2/agents   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"name": "Loan Pricing Engine Agent", "agent_type": "AI_AGENT",
       "capabilities": ["loan-pricing", "rate-calculation", "offer-generation"],
       "authority": {"maxPerTransaction": 50, "maxPerDay": 5000}}'

To list all registered agents:

bash
curl http://localhost:3000/ump/v2/agents   -H "X-API-Key: ump_sk_test_local"

8. Fund Wallets

Replace {wallet_id} with the wallet_id returned from agent registration. Run for each agent.

bash
curl -X POST http://localhost:3000/ump/v2/wallets/{wallet_id}/fund   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"amount": 100, "currency": "USD"}'
json — Response
{"wallet_id":"wallet_...","balance":100,"currency":"USD","status":"ACTIVE"}

9. Create Contracts

Contracts define pricing rules between agents. The loan pipeline flow: Credit Check → Fraud Risk → Income Verification → Loan Pricing.

bash — Contract 1: Credit Check → Fraud Risk ($5 flat fee)
curl -X POST http://localhost:3000/ump/v2/contracts   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"source_agent_id": "agent_2fed540460cb4a5b",
       "target_agent_id": "agent_85d48935cc74407d",
       "service_name": "fraud-risk-check",
       "pricing_rules": [{"primitive": "FLAT_FEE", "amount": 5.00, "currency": "USD"}]}'
bash — Contract 2: Fraud Risk → Income Verification ($5 flat fee)
curl -X POST http://localhost:3000/ump/v2/contracts   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"source_agent_id": "agent_85d48935cc74407d",
       "target_agent_id": "agent_3c9b26070180457e",
       "service_name": "income-verification",
       "pricing_rules": [{"primitive": "FLAT_FEE", "amount": 5.00, "currency": "USD"}]}'
bash — Contract 3: Income Verification → Loan Pricing ($5 flat fee)
curl -X POST http://localhost:3000/ump/v2/contracts   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"source_agent_id": "agent_3c9b26070180457e",
       "target_agent_id": "agent_7204eeb4a2ce4aec",
       "service_name": "loan-pricing",
       "pricing_rules": [{"primitive": "FLAT_FEE", "amount": 5.00, "currency": "USD"}]}'

10. Execute Transactions

Replace contract_id values with those returned from Step 9.

bash — Transaction 1: Credit Check pays Fraud Risk
curl -X POST http://localhost:3000/ump/v2/transact   -H "X-API-Key: ump_sk_test_local"   -H "Content-Type: application/json"   -d '{"from": "agent_2fed540460cb4a5b",
       "to": "agent_85d48935cc74407d",
       "contract_id": "contract_88ecfd5b034e4542",
       "service": "fraud-risk-check",
       "payload": {"application_id": "loan_app_001"}}'
json — Response
{
  "transaction_id": "txn_...",
  "cost": 5,
  "currency": "USD",
  "outcome": "COMPLETED",
  "audit_id": "audit_...",
  "settled_at": "2026-03-17T19:11:19.494Z",
  "duration_ms": 0
}

11. Query the Audit Trail

bash — Fetch all records
curl http://localhost:3000/ump/v2/audit   -H "X-API-Key: ump_sk_test_local"
bash — Filter by agent
curl "http://localhost:3000/ump/v2/audit?agent_id=agent_2fed540460cb4a5b"   -H "X-API-Key: ump_sk_test_local"
bash — Filter by operation
curl "http://localhost:3000/ump/v2/audit?operation=TRANSACTION_SETTLED"   -H "X-API-Key: ump_sk_test_local"

12. Check Wallet Balances

bash
curl http://localhost:3000/ump/v2/wallets/{wallet_id}/balance   -H "X-API-Key: ump_sk_test_local"

Expected balances after one full pipeline run:

AgentExpected BalanceReason
Credit Check Agent$95.00Spent $5.00
Fraud Risk Model Agent$100.00Received $5.00, spent $5.00
Income AI Verification Agent$100.00Received $5.00, spent $5.00
Loan Pricing Engine Agent$105.00Received $5.00, net earner

13. Reset Demo Data

⚠️
This runs TRUNCATE ... CASCADE on all 7 database tables including the live production database. Use with caution.
bash
curl -X POST http://localhost:3000/ump/v2/demo/reset   -H "X-API-Key: ump_sk_test_local"

Quick Reference: All Endpoints

MethodEndpointDescription
GET/healthHealth check (no auth required)
GET/ump/v2/agentsList all agents
POST/ump/v2/agentsRegister a new agent
GET/ump/v2/agents/:idGet agent details including wallet_id
POST/ump/v2/wallets/:id/fundFund a wallet
GET/ump/v2/wallets/:id/balanceGet wallet balance
GET/ump/v2/wallets/:id/ledgerGet full wallet transaction ledger
POST/ump/v2/contractsCreate a contract
GET/ump/v2/contractsList all contracts
POST/ump/v2/transactExecute a transaction
GET/ump/v2/auditQuery audit trail (supports ?agent_id= & ?operation=)
POST/ump/v2/demo/resetWipe all data (use with caution)

Common Errors & Fixes

ErrorCauseFix
Migration failed (no DB).env not loadedUse -r dotenv/config flag when starting server
TSError: No overloadTypeScript type errorUse --transpile-only flag with ts-node
ERR_MODULE_NOT_FOUNDWrong tsconfig moduleResolutionReplace tsconfig.json as per Step 3
Wallet not foundUsing agent_id instead of wallet_idCall GET /agents/:id to get the wallet_id
500 Internal Server ErrorDB connection failedCheck .env DATABASE_URL and Railway proxy status
Integrations

MCP Integration

The UMP MCP server exposes 18 tools directly inside Claude Desktop, Cursor, VS Code, and any MCP-compatible AI assistant. Register agents, execute transactions, query wallets, and manage contracts — without leaving your chat window.

Connect in 60 seconds

Add the following to your Claude Desktop claude_desktop_config.json:

json — Claude Desktop
{
  "mcpServers": {
    "ump": {
      "url": "https://ump-mcp-production.up.railway.app/mcp",
      "transport": "http",
      "headers": { "Authorization": "Bearer YOUR_UMP_KEY" }
    }
  }
}

For Cursor or VS Code (MCP settings):

json — Cursor / VS Code
{
  "ump": {
    "url": "https://ump-mcp-production.up.railway.app/mcp",
    "transport": "http",
    "headers": { "Authorization": "Bearer YOUR_UMP_KEY" }
  }
}
ℹ️
Replace YOUR_UMP_KEY with your API key. Any key starting with ump_sk_ is accepted during alpha (e.g. ump_sk_test_local).

Available Tools (18)

CategoryToolDescription
Agentsump_register_agentRegister a new agent with name, type, and spending limits
Agentsump_get_agentGet agent details including wallet ID and status
Agentsump_list_agentsList all registered agents with optional filters
Agentsump_update_authorityUpdate agent spending limits
Agentsump_revoke_agentRevoke an agent (cascades to children)
Walletsump_get_balanceGet real-time wallet balance
Walletsump_fund_walletAdd funds to a wallet
Walletsump_get_ledgerView full transaction ledger for a wallet
Walletsump_transferTransfer between wallets
Walletsump_freeze_walletEmergency freeze a wallet
Walletsump_unfreeze_walletUnfreeze a wallet
Transactionsump_transactExecute a full transaction (meter + rate + settle)
Transactionsump_get_transactionGet transaction details by ID
Transactionsump_simulate_pricingSimulate pricing without executing
Transactionsump_submit_usage_eventsSubmit batch usage events
Contractsump_create_contractCreate a contract between two agents
Contractsump_get_contractGet contract details
Contractsump_list_contractsList all contracts

Example Prompts

💡
"Register a new agent called search-bot with a $20/day spending limit"
💡
"Show me the last 10 transactions for wallet_8d4b1ef3"
💡
"Create a FLAT_FEE contract between agent_a and agent_b for fraud-check at $5 per call"
💡
"Execute a transaction from agent_abc to agent_def using contract_xyz for service loan-pricing"

MCP Server Health

bash
curl https://ump-mcp-production.up.railway.app/health
json
{
  "status": "ok",
  "name": "ump-mcp",
  "version": "1.0.0",
  "tools": 18,
  "transport": "streamable-http",
  "auth": "per-user Bearer token"
}