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.
https://api.umpledger.com/ump/v2@umpledger/sdk in your TypeScript/Node projectWhat 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
Base URL
https://api.umpledger.com/ump/v2
Authentication
All API requests (except GET /health) require an API key in the request header:
X-API-Key: your_api_key_here
Get your API key at umpledger.com/keys.
Quickstart
Get an agent transacting in under 5 minutes. This guide walks through creating two agents, funding one, and executing a transaction between them.
Create two agents
One agent will be the payer, the other the payee.
# 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", ... }
# 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", ... }
Fund the payer's wallet
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" }
Execute a transaction
Use the high-level /transact endpoint to meter, rate, and orchestrate settlement in one call.
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
}'
{
"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
}
Check the balance
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" }
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_*) - Type —
AI_AGENT,HUMAN_DELEGATE, orSYSTEM - 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:
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
max_per_transaction to prevent runaway spending.Authentication
All UMP API requests are authenticated with an API key passed as a request header.
API Key Header
curl https://api.umpledger.com/ump/v2/agents \
-H "X-API-Key: ump_live_your_key_here"
Unauthenticated response
{
"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:
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
Agents
Agents are the primary actors in the UMP network. Every agent has an identity, capabilities, spending limits, and an associated wallet.
Creates a new Agent Identity and automatically provisions a wallet for it.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | required | Human-readable display name |
| type | string | optional | AI_AGENT (default), HUMAN_DELEGATE, SYSTEM |
| parent_id | string | optional | Agent ID of parent for hierarchy |
| capabilities | string[] | optional | Service identifiers this agent can provide/consume |
| authority.max_per_transaction | number | optional | Max spend per single transaction |
| authority.max_per_day | number | optional | Daily spending cap |
| authority.max_per_month | number | optional | Monthly spending cap |
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
}
}'
{
"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"
}
Retrieve full details for an agent including its current wallet balance.
curl https://api.umpledger.com/ump/v2/agents/agent_a1b2c3d4 \
-H "X-API-Key: YOUR_KEY"
Query parameters
| Parameter | Type | Description |
|---|---|---|
| parent_id | string | Filter by parent agent |
| type | string | Filter by agent type |
| status | string | ACTIVE, REVOKED |
curl "https://api.umpledger.com/ump/v2/agents?status=ACTIVE" \
-H "X-API-Key: YOUR_KEY"
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 }'
Verify that an agent is valid, active, and authorized to transact.
curl -X POST https://api.umpledger.com/ump/v2/agents/agent_a1b2c3d4/verify \
-H "X-API-Key: YOUR_KEY"
{ "agent_id": "agent_a1b2c3d4", "valid": true, "reason": null, "verified_at": "2026-03-08T..." }
curl -X DELETE https://api.umpledger.com/ump/v2/agents/agent_a1b2c3d4 \
-H "X-API-Key: YOUR_KEY"
{ "revoked_agents": ["agent_a1b2c3d4", "agent_child1"], "count": 2 }
Wallets
Every agent has a wallet. Wallets hold balances, track every transaction in a ledger, and can be frozen for emergency control.
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | number | required | Amount to add in USD |
| currency | string | required | Currency code (e.g. USD) |
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" }'
curl https://api.umpledger.com/ump/v2/wallets/wallet_e5f6g7h8/balance \
-H "X-API-Key: YOUR_KEY"
{
"wallet_id": "wallet_e5f6g7h8",
"balance": 100,
"currency": "USD",
"status": "ACTIVE"
}
| Parameter | Type | Description |
|---|---|---|
| limit | number | Max entries to return (default 50) |
| offset | number | Pagination offset (default 0) |
| Parameter | Type | Required | Description |
|---|---|---|---|
| target_agent_id | string | required | Recipient agent ID |
| amount | number | required | Amount to transfer |
Immediately blocks all transactions. Use POST /wallets/:id/unfreeze to restore.
Transactions
Execute value transfers between agents. Use the high-level /transact endpoint for most cases, or call each pipeline stage individually for advanced control.
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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| from | string | required | Payer agent ID |
| to | string | required | Payee agent ID |
| contract_id | string | required | Contract ID governing the pricing rules |
| service | string | required | Service identifier matching contract service_name |
| payload | object | optional | Service-specific metadata (e.g. {"application_id": "loan_001"}) |
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" }
}'
{
"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
}
Record metering events without immediately settling. Use this when you need to batch events before rating.
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"
}
]'
curl https://api.umpledger.com/ump/v2/transactions/txn_a1b2c3d4 \
-H "X-API-Key: YOUR_KEY"
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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| source_agent_id | string | required | Paying agent (payer) |
| target_agent_id | string | required | Receiving agent (payee) |
| service_name | string | required | Service identifier (e.g. fraud-risk-check) |
| pricing_rules | object[] | required | Array of pricing rule objects. Each rule: {"primitive": "FLAT_FEE", "amount": 5.00, "currency": "USD"} |
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"
}]
}'
Creates a DYNAMIC contract proposal. The counterparty can then accept or counter-propose via /contracts/:id/accept or /contracts/:id/counter.
curl https://api.umpledger.com/ump/v2/contracts/ctr_xyz \
-H "X-API-Key: YOUR_KEY"
Terminates the contract immediately. Existing settled transactions are unaffected.
Audit Trail
Every transaction automatically creates an immutable audit record. Query audit logs for compliance, debugging, and dispute resolution.
curl https://api.umpledger.com/ump/v2/audit/aud_e5f6g7h8 \
-H "X-API-Key: YOUR_KEY"
{
"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
}
| Parameter | Type | Description |
|---|---|---|
| agent_id | string | Filter by agent ID (payer or payee) |
| operation | string | Filter by operation type (e.g. TRANSACTION_SETTLED) |
| from_date | ISO date | Start of date range |
| to_date | ISO date | End of date range |
| limit | number | Max records (default 50) |
SDK Installation
The @umpledger/sdk package lets you embed UMP directly in your Node.js or TypeScript application — no HTTP calls needed.
Install
npm install @umpledger/sdk
Initialize
import { UMP } from '@umpledger/sdk';
const ump = new UMP({
// Optional config — defaults work for alpha
});
api.umpledger.com automatically.Requirements
- Node.js 18+
- TypeScript 5+ (optional but recommended)
SDK — Agents
Manage agent identities programmatically using the SDK.
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 — Wallets
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 — Transactions
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 — Contracts
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');
Error Reference
UMP API errors always return a JSON body with error and message fields.
| Error Code | HTTP | Description |
|---|---|---|
| AUTHENTICATION_REQUIRED | 401 | Missing or invalid API key |
| AGENT_NOT_FOUND | 404 | Agent ID does not exist |
| WALLET_NOT_FOUND | 404 | Wallet ID does not exist |
| INSUFFICIENT_FUNDS | 402 | Wallet balance too low for transaction |
| AUTHORITY_EXCEEDED | 403 | Transaction exceeds agent's spending limit |
| WALLET_FROZEN | 403 | Wallet is frozen — all transactions blocked |
| CONTRACT_NOT_FOUND | 404 | Contract ID does not exist |
| CONTRACT_EXPIRED | 410 | Contract is past its effective_until date |
| MAX_COST_EXCEEDED | 402 | Transaction cost exceeded the max_cost ceiling |
| RATE_LIMIT_EXCEEDED | 429 | Too many requests — 1000/minute limit reached |
| VALIDATION_ERROR | 400 | Request body failed schema validation |
| INTERNAL_ERROR | 500 | Unexpected server error |
Error response format
{
"error": "INSUFFICIENT_FUNDS",
"message": "Wallet wal_xyz has insufficient balance. Available: 10, Required: 50",
"docs": "https://docs.umpledger.com"
}
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/sdknpm package- Live API at
api.umpledger.com
Local Testing Guide
Run the UMP server locally against a live Railway PostgreSQL database. From zero to live API in 10 minutes.
POST /ump/v2/demo/reset to wipe all data when needed.1. Prerequisites
Install the following on your machine:
- Git — git-scm.com/download/win
- Node.js 18+ — nodejs.org (LTS version)
2. Clone & Install
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:
{
"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
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
npx ts-node --transpile-only -r dotenv/config src/server.ts
Expected output:
[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
curl http://localhost:3000/health
{"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.
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}}'
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}}'
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}}'
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:
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.
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"}'
{"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.
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"}]}'
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"}]}'
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.
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"}}'
{
"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
curl http://localhost:3000/ump/v2/audit -H "X-API-Key: ump_sk_test_local"
curl "http://localhost:3000/ump/v2/audit?agent_id=agent_2fed540460cb4a5b" -H "X-API-Key: ump_sk_test_local"
curl "http://localhost:3000/ump/v2/audit?operation=TRANSACTION_SETTLED" -H "X-API-Key: ump_sk_test_local"
12. Check Wallet Balances
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:
| Agent | Expected Balance | Reason |
|---|---|---|
| Credit Check Agent | $95.00 | Spent $5.00 |
| Fraud Risk Model Agent | $100.00 | Received $5.00, spent $5.00 |
| Income AI Verification Agent | $100.00 | Received $5.00, spent $5.00 |
| Loan Pricing Engine Agent | $105.00 | Received $5.00, net earner |
13. Reset Demo Data
TRUNCATE ... CASCADE on all 7 database tables including the live production database. Use with caution.curl -X POST http://localhost:3000/ump/v2/demo/reset -H "X-API-Key: ump_sk_test_local"
Quick Reference: All Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /health | Health check (no auth required) |
| GET | /ump/v2/agents | List all agents |
| POST | /ump/v2/agents | Register a new agent |
| GET | /ump/v2/agents/:id | Get agent details including wallet_id |
| POST | /ump/v2/wallets/:id/fund | Fund a wallet |
| GET | /ump/v2/wallets/:id/balance | Get wallet balance |
| GET | /ump/v2/wallets/:id/ledger | Get full wallet transaction ledger |
| POST | /ump/v2/contracts | Create a contract |
| GET | /ump/v2/contracts | List all contracts |
| POST | /ump/v2/transact | Execute a transaction |
| GET | /ump/v2/audit | Query audit trail (supports ?agent_id= & ?operation=) |
| POST | /ump/v2/demo/reset | Wipe all data (use with caution) |
Common Errors & Fixes
| Error | Cause | Fix |
|---|---|---|
| Migration failed (no DB) | .env not loaded | Use -r dotenv/config flag when starting server |
| TSError: No overload | TypeScript type error | Use --transpile-only flag with ts-node |
| ERR_MODULE_NOT_FOUND | Wrong tsconfig moduleResolution | Replace tsconfig.json as per Step 3 |
| Wallet not found | Using agent_id instead of wallet_id | Call GET /agents/:id to get the wallet_id |
| 500 Internal Server Error | DB connection failed | Check .env DATABASE_URL and Railway proxy status |
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:
{
"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):
{
"ump": {
"url": "https://ump-mcp-production.up.railway.app/mcp",
"transport": "http",
"headers": { "Authorization": "Bearer YOUR_UMP_KEY" }
}
}
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)
| Category | Tool | Description |
|---|---|---|
| Agents | ump_register_agent | Register a new agent with name, type, and spending limits |
| Agents | ump_get_agent | Get agent details including wallet ID and status |
| Agents | ump_list_agents | List all registered agents with optional filters |
| Agents | ump_update_authority | Update agent spending limits |
| Agents | ump_revoke_agent | Revoke an agent (cascades to children) |
| Wallets | ump_get_balance | Get real-time wallet balance |
| Wallets | ump_fund_wallet | Add funds to a wallet |
| Wallets | ump_get_ledger | View full transaction ledger for a wallet |
| Wallets | ump_transfer | Transfer between wallets |
| Wallets | ump_freeze_wallet | Emergency freeze a wallet |
| Wallets | ump_unfreeze_wallet | Unfreeze a wallet |
| Transactions | ump_transact | Execute a full transaction (meter + rate + settle) |
| Transactions | ump_get_transaction | Get transaction details by ID |
| Transactions | ump_simulate_pricing | Simulate pricing without executing |
| Transactions | ump_submit_usage_events | Submit batch usage events |
| Contracts | ump_create_contract | Create a contract between two agents |
| Contracts | ump_get_contract | Get contract details |
| Contracts | ump_list_contracts | List all contracts |
Example Prompts
MCP Server Health
curl https://ump-mcp-production.up.railway.app/health
{
"status": "ok",
"name": "ump-mcp",
"version": "1.0.0",
"tools": 18,
"transport": "streamable-http",
"auth": "per-user Bearer token"
}