Pay-Per-Call Integration

Latch gives developers two flexible paths to add on-chain pricing and access control to any MCP or HTTP-based service — either visually through the dashboard or programmatically with the SDK. Both paths follow the same x402 pay-per-call standard.


Path Overview

Path
Best For
What It Does

Dashboard

Fast setup, existing APIs

Configure pricing per tool or route directly from the Latch interface.

SDK

Custom logic, full integration

Define paid tools in code, set pricing models, and deploy MCP servers with x402 built in.


Dashboard (No-Code)

Set pricing and protection for your MCP or HTTP endpoints — no code changes needed.

Steps:

  1. Visit latchmcp.app/register and enter your MCP or API URL.

  2. Select the tools or routes you want to monetize.

  3. Choose a price (e.g., $0.05 per call), asset (e.g., USDC), and chain (e.g., Base).

  4. Publish — your Latch-enabled endpoint is now pay-protected.

Best for:

  • Wrapping existing APIs without touching backend code

  • Quickly turning public tools into paid MCP endpoints


SDK (In-Code)

Use the Latch SDK when you want to define everything in code — from pricing logic to policy-based access.

Attach per-call pricing to any MCP or HTTP handler and let the SDK handle the x402 payment → verification → retry cycle automatically.

Best for:

  • Developers who need fine-grained pricing and validation control

  • Works seamlessly with frameworks like Next.js, Express, Hono, or Cloudflare Workers

Last updated