Skip to content

Developers

Build on Ambr

REST API, A2A JSON-RPC, and MCP integration for AI agent contract management.

POST/v1/contracts

Create a new Ricardian Contract from a template. Returns a draft that both parties must sign.

POST /v1/contractstypescript
const response = await fetch('https://getamber.dev/api/v1/contracts', {
  method: 'POST',
  headers: {
    'X-API-Key': '<API_KEY>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    template: 'c1-api-access',
    parameters: {
      buyer_name: 'Acme Analytics Ltd.',
      buyer_agent_id: '0x7a3b...9f2e',
      seller_name: 'DataCo Inc.',
      api_endpoint: 'https://api.dataco.io/v1',
      pricing_model: 'per-call',
      price_per_call: 0.002,
      currency: 'USDC', // also supports USDbC, DAI, ETH, WETH, cbETH, cbBTC
      sla_uptime_percent: 99.9,
      governing_law: 'Singapore',
    },
    principal_declaration: {
      agent_id: '0x7a3b...9f2e',
      principal_name: 'Acme Analytics Ltd.',
      principal_type: 'company',
    },
  }),
});
// response.status → 'draft'
// response.sign_url → '/api/v1/contracts/amb-2026-0001/sign'
POST/v1/contracts/:id/sign

Sign a contract with an ECDSA wallet signature. Both parties must sign to activate.

POST /v1/contracts/:id/signtypescript
const response = await fetch(
  'https://getamber.dev/api/v1/contracts/amb-2026-0001/sign',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      wallet_address: '0x7a3b...9f2e',
      signature: '0x1234...abcd',
      message: 'I agree to the terms of contract with hash: <sha256_hash>',
    }),
  }
);
// First sig:  draft → pending_signature
// Second sig: pending_signature → active
GET/v1/contracts/:id

Query contract status, metadata, and amendment chain. Full text requires API key or share token.

GET /v1/contracts/:idtypescript
const contract = await fetch(
  'https://getamber.dev/api/v1/contracts/amb-2026-0001',
  { headers: { 'X-API-Key': '<API_KEY>' } }
).then(r => r.json());

// contract.status → 'draft' | 'handshake' | 'pending_signature' | 'active' | 'amended'
// contract.sha256_hash → 'a1b2c3...'
// contract.amendment_chain → [{ hash, parent_hash, type }]
POST/v1/contracts/:id/handshake

Submit a handshake response — accept, reject, or request changes to a draft contract. Includes visibility preference.

POST /v1/contracts/:id/handshaketypescript
const response = await fetch(
  'https://getamber.dev/api/v1/contracts/amb-2026-0001/handshake',
  {
    method: 'POST',
    headers: {
      'X-API-Key': '<API_KEY>',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      action: 'accept', // 'accept' | 'reject' | 'request_changes'
      visibility: 'parties_only', // 'public' | 'parties_only' | 'private'
      message: 'Terms accepted. Proceeding to signature.',
    }),
  }
);
// action: accept → draft → pending_signature
// action: request_changes → remains draft with change request attached
POST/v1/contracts/:id/wallet-auth

Verify wallet ownership for contract access. Returns a signed challenge for authenticated reads.

POST /v1/contracts/:id/wallet-authtypescript
const response = await fetch(
  'https://getamber.dev/api/v1/contracts/amb-2026-0001/wallet-auth',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      wallet_address: '0x7a3b...9f2e',
      signature: '0xabcd...1234',
      message: 'Authenticate wallet for contract amb-2026-0001',
    }),
  }
);
// response.access_token → short-lived JWT for contract reads
POST/v1/dashboard/wallet-auth

Dashboard login via wallet signature. Returns a session token for the Ambr dashboard.

POST /v1/dashboard/wallet-authtypescript
const response = await fetch(
  'https://getamber.dev/api/v1/dashboard/wallet-auth',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      wallet_address: '0x7a3b...9f2e',
      signature: '0xabcd...1234',
      message: 'Sign in to Ambr Dashboard',
    }),
  }
);
// response.session_token → use in Authorization header for dashboard API
POST/v1/keys

Activate an API key with on-chain payment verification. Requires a Base L2 transaction hash.

POST /v1/keystypescript
const response = await fetch(
  'https://getamber.dev/api/v1/keys',
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      wallet_address: '0x7a3b...9f2e',
      tx_hash: '0x9876...fedc',
      chain: 'base',
    }),
  }
);
// response.api_key → 'ambr_live_...'
// response.tier → 'developer' | 'startup' | 'scale' | 'enterprise'

Contract Lifecycle

Contracts are created as drafts. The counterparty reviews and submits a handshake — accepting, rejecting, or requesting changes. Once accepted, the first ECDSA wallet signature moves the contract to pending_signature. When the second party signs, the contract becomes active. Both signatures are cryptographically verified — no API key needed to sign, just a valid wallet.

MCP Integration

Add Ambr to your AI agent with one config block. Works with Claude Code, Cursor, and any MCP-compatible client. Your agent gets 6 tools: list templates, create contracts, get/verify contracts, check status, and agent handshake.

Claude Code — settings.json

Claude Code MCP Configtypescript
{
  "mcpServers": {
    "ambr": {
      "type": "url",
      "url": "https://getamber.dev/api/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Cursor — .cursor/mcp.json

Cursor MCP Configtypescript
{
  "mcpServers": {
    "ambr": {
      "url": "https://getamber.dev/api/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Get your API key at /activate. Tools that modify state (create contract, agent handshake) require a valid key. Read-only tools (list templates, verify hash) work without authentication.

Integrations

Supported Stack

Production integrations powering Ambr's contract infrastructure.

x402 V2

Live

HTTP-native micropayments on Base L2. Multi-token: USDC, USDbC, DAI, ETH, WETH, cbETH, cbBTC.

A2A Agent Card

Live

JSON-RPC discovery at getamber.dev/.well-known/agent.json. Agents find and interact with Ambr automatically.

MCP Server

Live

Model Context Protocol integration. Add Ambr to Claude, Cursor, or any MCP-compatible agent.

Base L2

Live

cNFT minting, SHA-256 hash storage, and counterparty-gated transfers on Base mainnet.

Stripe Payments

Live

Card payments for API key activation. Starter, Builder, and Enterprise tiers.

ZK Identity

Live

Zero-knowledge identity verification via Groth16/BN128 zk-SNARKs powered by the Demos Network. Prove entity status without revealing identity.

Start Building

Free developer access — 25 contracts, no payment required. Full REST API, A2A discovery, and MCP integration.