§ 01 — Getting Started
What is Ambr
Ambr is the signed record of what an AI agent may do. Each agreement records who authorized an agent, in what scope, under which law. Create, sign, and verify these dual-format Ricardian contracts through a single API -- no human bottleneck, no PDF workflows.
Get a Free Developer Key
Go to getamber.dev/activate, enter your email, and open the link we send you — that verifies the address and reveals your key. The link works once and expires in 30 minutes. The free developer tier includes 500 credits (cents) once per verified key, with no payment required. Keys are stored hashed and cannot be shown twice, so save it when you get there; if you lose it, request another link and it will issue a replacement.
Your First Agreement
Create a delegation agreement (template d1-general-auth) with a single POST request. Every request needs a template slug, a principal_declaration, and the template's required parameters:
curl -X POST https://getamber.dev/api/v1/contracts \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_KEY" \
-d '{
"template": "d1-general-auth",
"principal_declaration": {
"agent_id": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"principal_name": "Acme Corp",
"principal_type": "company"
},
"parameters": {
"principal_name": "Acme Corp",
"principal_type": "corporation",
"principal_registration_number": "DE-5589021",
"principal_address": "1209 Orange St, Wilmington, DE 19801",
"agent_id": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F",
"agent_type": "autonomous",
"scope": "procurement and vendor payments",
"categories": ["procurement", "api-calls"],
"spending_limit_per_tx": 2500,
"spending_limit_monthly": 10000,
"duration_months": 12,
"governing_law": "Delaware"
}
}'The response returns the agreement's contract_id, a SHA-256 content hash, a reader URL for the counterparty, and a sign URL for wallet-based execution. Call GET /api/v1/templates for each template's full parameter list.
§ 02 — Contract Lifecycle
Create
POST /api/v1/contracts creates a new agreement draft (a dual-format Ricardian contract) from a template. The response includes the agreement's ID, a SHA-256 content hash, a reader URL (with embedded share token), a sign URL, and a handshake URL.
{
"contract_id": "amb-2026-0042",
"sha256_hash": "9f86d081884c...",
"status": "draft",
"reader_url": "https://getamber.dev/reader/9f86d081884c...?token=...",
"sign_url": "https://getamber.dev/api/v1/contracts/amb-2026-0042/sign",
"handshake_url": "https://getamber.dev/api/v1/contracts/amb-2026-0042/handshake",
"next_step": "Contract created as draft. Both parties sign (ECDSA) to activate."
}Handshake
POST /api/v1/contracts/:id/handshake lets the counterparty accept, reject, or request changes to an agreement. The handshake also records a visibility preference (private, metadata-only, public, or encrypted).
{
"action": "accept", // "accept" | "reject" | "request_changes"
"visibility": "private", // "private" | "metadata_only" | "public" | "encrypted"
"wallet_address": "0x..."
}Sign
POST /api/v1/contracts/:id/sign submits an ECDSA wallet signature. Bilateral agreements require two signatures: the first moves the agreement to pending status, the second activates it and triggers on-chain minting. One-sided agreements (P2 Power of Attorney) activate on the principal's single signature.
A wallet named in the contract signs without an API key. If the principal side names no wallet, only the creator can fill it: the creating account's bound wallet if it has one, otherwise the creating API key (X-API-Key). If the counterparty side names no wallet, it is filled by invitation: send the token from POST /api/v1/contracts/:id/share as share_token in the sign body (full access; a scope token is not enough).
Verify
GET /api/v1/contracts/:id returns the full agreement including its SHA-256 hash. Compare this hash against the on-chain record to verify the agreement has not been tampered with since signing.
§ 03 — Agent Integration
A2A Discovery
AI agents discover Ambr through the standard A2A well-known endpoint:
GET https://getamber.dev/.well-known/agent.json
The agent card describes available capabilities, authentication methods, and supported interaction protocols.
MCP Server
Add Ambr as an MCP server in your agent configuration:
{
"mcpServers": {
"ambr": {
"url": "https://getamber.dev/api/mcp",
"headers": { "X-API-Key": "YOUR_KEY" }
}
}
}The MCP server exposes seven tools -- ambr_list_templates, ambr_create_contract, ambr_get_contract, ambr_get_contract_status, ambr_verify_hash, ambr_check_transaction, and ambr_agent_handshake -- so any MCP-compatible agent can manage agreements natively. Contract creation accepts an API key or x402 pay-per-call.
REST API
All endpoints accept and return JSON. Authenticate with the X-API-Key header or a share token where noted. Base URL: https://getamber.dev/api/v1
Pay per agreement with x402
Instead of an API key, agents can pay per agreement using the x402 protocol. Include a payment header with each request. The server validates the payment proof on-chain before processing the agreement creation. This enables fully autonomous agent-to-agent commerce without pre-registration.
§ 04 — API Reference
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /v1/contracts | API Key or x402 | Create contract |
| GET | /v1/contracts/:id | API Key or share token | Get contract |
| POST | /v1/contracts/:id/handshake | Share token + wallet | Accept / reject |
| POST | /v1/contracts/:id/sign | Wallet signature; open principal side: creator; open counterparty side: share token | Sign contract |
| POST | /v1/contracts/:id/check | API key or share token (public contracts: none) | Check a payment against the limits of the agreement (free, advisory): within_limits, out_of_scope, needs_approval or incomplete, plus not_checked, a best-effort list of parts to start with (always read the agreement's scope and conditions yourself; a missing entry does not mean nothing is left to read) |
| POST | /v1/contracts/:id/wallet-auth | Wallet signature | Prove wallet association |
| GET | /v1/templates | None | List templates |
| POST | /v1/keys | None | Activate API key (developer free; Starter and Scale credit packs paid by card via Stripe Checkout at /activate, or with a Base token-transfer tx_hash (USDC, DAI, ETH and others) on this endpoint – Team subscription via /activate) |
| POST | /v1/identity/verify | API Key or share token | Submit a ZK identity proof (coming soon) |
| POST | /v1/dashboard | API Key | Dashboard data |
| POST | /v1/dashboard/wallet-auth | Wallet signature | Dashboard via wallet |
Copy-paste request examples for every endpoint — including error codes and rate limits — live on the developers page.
§ 05 — Wallet & Identity
Connect Wallet
The Ambr dashboard supports dual login: authenticate with your API key or connect a wallet directly. Wallet connection links your on-chain identity to your Ambr account, enabling signature-based contract execution and cNFT management.
Wallet Auth
The Reader Portal uses ECDSA signature verification for counterparty authentication. When a counterparty visits the reader URL, they sign a challenge message with their wallet to prove identity before viewing or signing the contract.
Contract NFTs
Each fully-signed contract is minted as an ERC-721 cNFT on Base L2. The token stores the SHA-256 content hash on-chain, creating an immutable record that the contract existed in its exact form at the time of signing. The NFT metadata links back to the Ambr reader for the full contract text.
Transfers
Contract NFTs use counterparty-gated transfers. Both signing parties must approve a transfer before the NFT can move to a new wallet. This prevents unilateral reassignment of contractual obligations.
§ 06 — Payment Methods
Pricing
Pay per agreement with x402 (agent-native)
No account needed. Agents pay per agreement in USDC on Base L2 with a standard x402 v2 client: the first call returns 402 with a PAYMENT-REQUIRED header, and the retry carries a signed PAYMENT-SIGNATURE header. Live rates for the full catalog: GET /api/v1/pricing.
| Agreement | Price | Use Case |
|---|---|---|
| Power of Attorney (P2) | $0.20 | Authorize your own agent — one signature |
| Delegation (D1) | $0.50 | Delegate authority to your agent, with spending caps |
| Agent-to-Agent (A2A) | $1.00 | One agent commissions and pays another |
| Fleet (d3) | $2.50 | Shared budgets & sub-delegation across a fleet |
| cNFT minting (gas) | included | Base L2 mint cost absorbed |
| Handshake / Sign / Verify | Free | Lifecycle actions never charged |
| Reader Access | Free | Counterparties always free |
Monthly Subscriptions (Predictable Billing)
For teams that prefer a monthly plan with included credits. Purchase via getamber.dev/activate (Stripe Checkout). The free tier -- 500 credits (cents) once per verified key, no card -- is described above.
| Plan | Price | Credits | Notes |
|---|---|---|---|
| Team | $29/month | 3,000 | Granted per paid invoice; buy a pack for more |
| Enterprise | $4,800/year | 24,000 | Private verifier, DPA, audit export |
Credit Packs (One-Time)
Prefer to top up without a subscription? Buy a one-time credit pack -- credits are added to your key and do not expire.
| Pack | Price | Credits |
|---|---|---|
| Starter Pack | $49 | 4,900 |
| Scale Pack | $199 | 21,900 |
Crypto
Pay for contracts with 7 tokens on Base L2:
| Token | Type |
|---|---|
| USDC | Stablecoin |
| USDbC | Bridged USDC |
| DAI | Stablecoin |
| ETH | Native |
| WETH | Wrapped ETH |
| cbETH | Coinbase staked ETH |
| cbBTC | Coinbase wrapped BTC |
Card Payments
Stripe Checkout handles card payments for the Team monthly subscription and for the Starter and Scale credit packs. Enterprise is a contact CTA. Use the free tier or x402 crypto payments to get started without a card.
§ 07 — Trust Layer
ZK Identity (coming soon)
Ambr uses zero-knowledge proof identity verification via Groth16/BN128 zk-SNARKs powered by the DemosSDK. Counterparties prove attributes about themselves — jurisdiction, accreditation, age, or KYC status — without revealing the underlying data. The verifier receives a cryptographic proof, not raw personal information.
Proofs are verified server-side using the identity_with_merkle circuit. Each proof generates a unique nullifier that prevents replay attacks. Identity attestations are stored alongside the contract signature in the immutable record.
Signing with a verified identity is coming soon. Until identities can be registered, contract creation rejects require_zk_identity: true with HTTP 400 zk_identity_unavailable. Once available, enable ZK identity verification on any contract by setting require_zk_identity: true in the contract creation parameters. When enabled, signers must complete identity verification before their signature is accepted.
The proof must be generated under the context ambr_contract:<contract_id> for the agreement being signed, so it cannot be reused on another contract. /api/v1/identity/verify now requires a contract_id. The server also checks the proof's Merkle root against the Demos node's current root; a proof made against an older root must be regenerated. Errors: zk_context_mismatch (wrong contract), zk_root_mismatch (stale root, regenerate), and zk_root_unverified (the node could not be reached; HTTP 503, retry later).
Usage
POST /api/v1/contracts
{
"template": "d1-general-auth",
"require_zk_identity": true,
"parameters": { ... },
"principal_declaration": { ... }
}Dual-format architecture: every contract exists as legal prose and machine-parsable JSON, linked by SHA-256 hash.