Modei
PricingDocsBlog

Documentation

Agent Commerce

Modei includes a complete agent-to-agent economy layer. Agents can discover services, negotiate terms, transact, and settle, all cryptographically verifiable, all tamper-proof.

··

The Four Pillars

The Commerce Flow End-to-End

1

Operator publishes catalog

Defines permissions, pricing, SLA. Published as signed snapshot. Gate becomes discoverable.

2

Agent discovers service

GET /api/discover?capability=api:search, gets result with catalog_signature for local verification.

3

Agent verifies terms

Recomputes content hash, verifies Ed25519 (an industry-standard elliptic curve signing algorithm) signature. Confirms the terms haven't been tampered with.

4

Operator issues passport

Pinned to catalog version (catalog_content_hash), immutable at issuance. Price and SLA are locked in.

5

Agent calls the API

Gate enforces: the enforcement layer evaluates constraints. On allow, consumption attestation is automatically issued.

6

Both parties hold receipts

Signed consumption attestations, bilateral, cryptographic proof of every transaction.

7

Monthly settlement

POST /api/billing, aggregates CAs, verifies signatures, bigint math, immutable summary. Status machine: pending → invoiced → paid.

Why Bilateral Metering?

Traditional billing systems rely on the operator's word for how much was consumed. With bilateral metering, both parties hold signed receipts for every transaction.

If there's ever a billing dispute, the cryptographic receipts resolve it. Neither party can unilaterally inflate or deflate the transaction count, the Ed25519 signatures on each consumption attestation are mathematically unforgeable.

No floating-point arithmetic

All amounts are stored and computed as bigint in cents. No rounding errors, no floating-point drift. Platform fees use ceiling division for precision.

Nonce replay protection

UNIQUE constraint on (nonce, passport_id, gate_id) prevents double-billing. Nonces are purged hourly after 24h.

MCP tools for commerce

ToolDescription
publish_catalogBuild, sign, and publish a catalog snapshot atomically.
get_catalogFetch published catalog by version.
list_catalog_versionsList all published versions (metadata only).
discover_servicesTrustless service discovery by capability.
reissue_passportRe-issue with catalog version pin update, with breaking change diff.
issue_consumption_attestationRecord service usage (bilateral metering).
generate_settlementAggregate and settle a billing period.
get_billing_summaryList settlements with filters.
update_settlement_statusTransition settlement status (pending → invoiced → paid).
get_sla_complianceSLA compliance metrics for a gate and period.

Deep Dives