Loopwall

Price: $0.0005 USDC per call

Endpoint: https://loopwall.melis.ai/issue

Method: POST

Pays to: 0x1C680703D6cF7dfC9FEABb5AA28E64B869ddB3bC

What it does

Multi-agent chains can loop infinitely and burn budgets unnoticed. Loopwall is the spine of safe x402 orchestration: call /issue at chain start to mint a signed Job Envelope ($0.001) with origin, max_hops, and USD budget cap; then call /hop at each subsequent step ($0.0005) to validate against loop detection, hop-limit, and remaining budget. The envelope is cryptographically signed so any downstream agent can verify chain provenance without trusting the caller. Use as the orchestration backbone for any LLM-driven workflow that calls paid services.

When to use it

  • Cap an LLM orchestrator at 10 paid x402 hops before manual review
  • Detect a planning agent recursively calling itself before it drains budget
  • Pass a signed budget envelope across agents in different organisations
  • Audit trail of which agent in a chain consumed which fraction of the budget

Request schema

{
  "origin": "planner-agent-v1",
  "max_hops": 10,
  "budget_usd": 1
}

Response schema

{
  "envelope_id": "env_7ea9afac-c3d1-4b2e-9f3a-1234abcd5678",
  "origin": "planner-agent-v1",
  "max_hops": 10,
  "hops_remaining": 10,
  "budget_usd": 1,
  "budget_remaining_usd": 1,
  "signature": "0xabc...",
  "issued_at": "2026-05-15T12:00:00Z",
  "payment_hash": "0x..."
}

Code example — TypeScript via MCP

Install the MCP server once; all 22 services become tool calls.

// Configure @melis-ai/x402-tools-mcp in your MCP client
// Then call the tool:

const result = await mcpClient.callTool("loopwall", {
  "origin": "planner-agent-v1",
  "max_hops": 10,
  "budget_usd": 1
});

console.log(result);
// ["envelope_id","origin","max_hops","hops_remaining","budget_...
→ MCP setup guide

Code example — Python via direct HTTP

import requests

# x402 payment header must be set by your wallet client
# See x402.org for client libraries

headers = {
    "Content-Type": "application/json",
    "x-payment": "<signed-x402-payment-header>",
}

resp = requests.post(
    "https://loopwall.melis.ai/issue",
    json={
      "origin": "planner-agent-v1",
      "max_hops": 10,
      "budget_usd": 1
    },
    headers=headers,
)
print(resp.json())

Code example — curl with internal key bypass

For testing with an issued internal key (skips x402 payment flow):

curl -X POST https://loopwall.melis.ai/issue \
  -H "Content-Type: application/json" \
  -H "x-internal-key: YOUR_KEY" \
  -d '{"origin":"planner-agent-v1","max_hops":10,"budget_usd":1}'

How is this different from alternatives?

Loopwall vs In-process loop counter

A local counter works inside one runtime but cannot enforce budget or chain provenance across agent handoffs. Loopwall signs the envelope so any agent in the chain can verify limits without trusting the caller — the right fit for cross-agent or cross-org orchestration.

Loopwall vs Workflow runtime limits (Inngest, Temporal)

Inngest and Temporal can enforce step limits within their own runtime. Loopwall is runtime-agnostic — any agent that can POST HTTP can participate in a Loopwall-protected chain regardless of framework.

FAQ

Does it work without an account?

Yes. x402 is account-less. Your agent's wallet signs the payment and retries automatically. No registration, no API key, no subscription.

What happens on failure?

/issue returns HTTP 400 for invalid max_hops or budget_usd. /hop returns HTTP 409 if the envelope has already exceeded its hop limit or budget; HTTP 410 if the envelope signature is invalid or expired. None of these settle payment.

What is the rate limit?

None published.

Is this open-source?

The service code is closed-source for security reasons. The MCP wrapper that calls it is open-source and MIT-licensed: github.com/mizukaizen/x402-tools-mcp .

Who built this?

Part of the melis.ai agent infrastructure stack. Running on a dedicated Helsinki VPS since early 2026. Contact sean@melis.ai.