M5 OS
Dev Docs
v0.5.0
M5 MEMBER
Overview
Introduction Authentication QuickstartStart
Identity
M5 DID Credentials Titlelock API
Payments
M5x402 Protocol Wallet SDK Settlement
Agents
Autonomous Agents Dagny API
Infrastructure
M5 Node M5scan API
M5 System · Developer Reference

Build on
sovereign infrastructure.

SDK v0.5.0 · Base Mainnet · M5x402 v1.2

M5 provides a complete set of APIs and SDKs for building sovereign applications — identity, payments, title, agents, and governance — all on-chain, all under constitutional-grade protections. Start with the quickstart below.

Quickstart
5 min setup
Identity SDK
DID + Credentials
M5x402 Payments
Protocol spec
Agents SDK
On-chain agents

Quickstart

Install the M5 SDK and authenticate your first sovereign identity in under 5 minutes.

Install

npm install @m5/sovereign-sdk
# or
yarn add @m5/sovereign-sdk

Initialize

import { M5Client } from '@m5/sovereign-sdk';

const client = new M5Client({
  network: 'base-mainnet',
  apiKey: process.env.M5_API_KEY,
});

// Resolve a sovereign identity
const identity = await client.identity.resolve('did:m5:0x...');
console.log(identity.credentials); // Verified. Sovereign.
REST API — Core Endpoints
GET /v1/identity/{did} Resolve a sovereign DID
POST /v1/identity/create Create a new M5 identity
POST /v1/credentials/issue Issue a verifiable credential
GET /v1/wallet/{address}/balance Get sovereign wallet balance
POST /v1/payments/x402 Initiate M5x402 payment
POST /v1/agents/deploy Deploy autonomous agent
GET /v1/titlelock/{assetId} Get title record for asset
DEL /v1/agents/{agentId} Deactivate deployed agent

Authentication

All M5 API requests authenticate via bearer token. Request an API key from the M5 Developer Portal. Tokens are scoped per identity and never grant custody over any assets.

# All requests require this header
Authorization: Bearer m5_sk_live_...

# Example with curl
curl -H "Authorization: Bearer m5_sk_live_..." \
     https://api.m5bank.app/v1/identity/did:m5:0x...

M5x402 Payment Protocol

M5x402 is M5's machine-native micropayment protocol. It enables HTTP-native payments — any resource can require payment before delivery, executed automatically without human intermediation. M5x402 is the brand-canonical reference; alongside M5-MCP (model context) and M5-A2A (agent-to-agent), it forms the standards triad for machine-native commerce on the World Sovereign Web.

import { M5x402 } from '@m5/sovereign-sdk';

// Protect a resource with M5x402
const handler = M5x402.protect({
  amount: '0.001',      // USDC
  network: 'base',
  recipient: process.env.M5_WALLET,
});

// Express middleware — payment required before response
app.get('/api/data', handler, (req, res) => {
  res.json({ data: 'sovereign' });
});
Full Developer Documentation
Read the complete spec — hosted at titlechain.mintlify.io
M5x402, M5-MCP, M5-A2A reference docs, SDK guides, endpoint schemas, contract ABIs, and certification flows. Versioned, searchable, and always current.
Open Full Docs ↗
M5x402 · Payments M5-MCP · Model Context M5-A2A · Agent-to-Agent