x402

🧩 Resources

Endpoint: https://x402.latchmcp.app Explorer: View on x402scan

The Latch API exposes core endpoints for interacting with x402 payments, MCP coordination, and autonomous agents. Each route supports authenticated pay-per-call access via the x402 protocol.


POST / Utility

Provides a root endpoint for the Latch layer, allowing clients to access essential services and resources without specific routing. This endpoint serves as the entry point for all Latch-based integrations and MCP-connected applications.

Example

curl -X POST https://x402.latchmcp.app/ \
  -H "Content-Type: application/json" \
  -d '{"ping": true}'

GET /pay Utility

Handles user-initiated payment requests through the Latch layer. It processes on-chain micropayments securely using the x402 protocol, letting clients send or receive tokens without altering their existing systems.

Example

curl -X GET https://x402.latchmcp.app/pay \
  -H "Authorization: Bearer <wallet_signature>"

Response

{
  "status": "paid",
  "tx": "0xabc123...",
  "amount": "0.01",
  "asset": "USDC"
}

POST /payment Utility

Performs payment initiation and settlement within the Latch layer, wrapping all x402 logic for token transfer and confirmation. Ideal for automated or programmatic micropayments requiring on-chain receipts.

Example

curl -X POST https://x402.latchmcp.app/payment \
  -H "Content-Type: application/json" \
  -d '{"to":"0xabc...","amount":"0.05","asset":"USDC"}'

POST /mcp Utility

Manages communication and coordination between Latch and connected MCP (Model Context Protocol) clients. Used by AI tools or models to interact with Latch for authenticated, programmable, payment-aware workflows.

Example

curl -X POST https://x402.latchmcp.app/mcp \
  -H "Content-Type: application/json" \
  -d '{"client":"chatgpt","tool":"summarize"}'

POST /agent AI

Registers and manages autonomous agents within the Latch ecosystem. Agents can represent users, tools, or services that execute or verify micropayments automatically.

Example

curl -X POST https://x402.latchmcp.app/agent \
  -H "Content-Type: application/json" \
  -d '{"agent":"data-oracle","wallet":"0x123..."}'

Response

{
  "registered": true,
  "agent": "data-oracle",
  "wallet": "0x123..."
}

💡 Notes

  • All endpoints comply with x402 Payment Required semantics.

  • Clients can interact directly or through the Latch SDK (withLatchClient() wrapper).

  • Each call automatically returns pricing metadata if payment is required.

Last updated