⚡ x402 · USDC on Base

AI Agent for USDC

Pay per request in USDC on Base. Current pilot services: generate-script, generate-function, refactor-code, explain-code, analyze-contract, generate-tutorial, audit-diff, summarize, tip-jar — no API keys or sign-ups. Machine discovery is available through OpenAPI.

Cheapest path: GET/POST /service/tip-jar → HTTP 402 → sign the x402 v2 challenge → PAYMENT-SIGNATURE. Catalog at /api.

Services & pricing

9 pilot services — each billed as a single micropayment. No subscriptions or API keys.

Generate a Node.js utility script

$2 USDC

Describe what you want the script to do. Returns clean, working Node.js code.

POST /service/generate-script

Generate a JavaScript function

$1 USDC

Describe a single function. Returns a well-documented JS function with types.

POST /service/generate-function

Refactor existing code

$3 USDC

Paste your code and describe improvements. Returns refactored version with notes.

POST /service/refactor-code

Explain how code works

$1 USDC

Paste code. Returns a plain-English explanation suitable for a junior dev.

POST /service/explain-code

Analyze a smart contract for vulnerabilities

$0.5 USDC

Pass a contract address (read on-chain source) or paste Solidity source code. Returns a security audit: vulnerability list, severity, and remediation.

POST /service/analyze-contract

Generate a technical tutorial

$0.25 USDC

Pick any topic and programming language. Returns a structured, beginner-to-advanced tutorial with code examples.

POST /service/generate-tutorial

Review a code diff for bugs

$0.25 USDC

Paste a unified diff and the language. Returns a focused review: bugs, regressions, edge cases, and suggestions.

POST /service/audit-diff

Summarize any text or URL

$0.05 USDC

Pass long text or a URL's content. Returns a concise structured summary with key points.

POST /service/summarize

Tip the operator ($0.01)

$0.01 USDC

Make a $0.01 USDC tip through the x402 v2 flow. Returns a thank-you receipt. Lowest-friction first payment to verify x402 flow.

POST /service/tip-jar

How it works

The x402 standard turns HTTP 402 into a real payment layer. Three steps from request to result.

1 · Submit

POST /service/audit-diff with { "diff": "...", "language": "..." }. The request body is limited to 1 MiB.

2 · Pay USDC

The server replies 402 Payment Required. The official x402 client signs the exact Base USDC authorization locally.

3 · Get the review

The client retries automatically. The service returns the AI-assisted review only after successful settlement.

Try the paid diff review

audit-diff reviews one unified diff for bugs, regressions, security issues, and edge cases. The pilot price is $0.25 USDC on Base.

# Use a fresh, low-balance customer wallet. Never paste its key into this website.
npm install @x402/fetch@2.20.0 @x402/evm@2.20.0 viem

# Save as pay.mjs, then run locally with EVM_PRIVATE_KEY set.
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const privateKey = process.env.EVM_PRIVATE_KEY;
if (!/^0x[0-9a-fA-F]{64}$/.test(privateKey || "")) throw new Error("EVM_PRIVATE_KEY is required");

const paidFetch = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{
    network: "eip155:8453",
    client: new ExactEvmScheme(privateKeyToAccount(privateKey)),
  }],
});

const response = await paidFetch("https://code.mamenesia.com/service/audit-diff", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    language: "javascript",
    diff: ["--- a/math.js", "+++ b/math.js", "@@ -1 +1 @@", "-return a + b", "+return a - b"].join("\n"),
  }),
});

console.log(response.status, await response.text());

The official x402 client reads PAYMENT-REQUIRED, signs the advertised Base USDC authorization locally, and retries with PAYMENT-SIGNATURE. Running this example can spend $0.25 USDC.

Payment wallet

This Base wallet receives payments settled through the advertised x402 v2 requirements. Use the PAYMENT-SIGNATURE flow above.

USDC · Base · official Circle contract
0xc7e77CF4Bd5F7f1307d5846b1dbFcf0812FC0A46

FAQ

Common questions about the service, payments, and the x402 standard.

What is x402?

x402 is an open payment standard built on HTTP 402 Payment Required. It lets HTTP servers charge for resources using crypto (USDC on Base) without API keys or sign-ups.

Which blockchain and token do you use?

Payments are made in USDC on the Base network (chainId 8453), the official Circle USDC contract at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913.

How do I pay?

Run the official x402 client example above on your own machine with a fresh, low-balance wallet holding Base USDC. The client handles PAYMENT-REQUIRED and PAYMENT-SIGNATURE. Never send your private key to this service.

What model generates the code?

Code is generated by glm-5.2 via OpenAgentic, with automatic fallback to kimi-k2.7-code, glm-5.1, and glm-5 for reliability.

What if delivery fails?

The service normally settles only after successful generation. If the on-chain payment settles but no result is delivered, email ops@mamenesia.com with the transaction hash within 7 days. Verified delivery failures are manually refunded to the payer address.

Is this a formal security audit?

No. audit-diff is an AI-assisted review aid and may miss defects or report false positives. Validate every finding and use human review for security-critical changes.

What data should I submit?

Submit only the unified diff and an optional language hint. Do not include private keys, credentials, personal data, or proprietary code you are not authorized to share.