x402hub
← Social & Twitter

api-production-853c.up.railway.app · repair

api-production-853c.up.railway.app · https://api-production-853c.up.railway.app/v1/repair
💵 $0.006 USDC per call 🌐 Base 📈 2 calls / 30d · 1 unique payers

Repair invalid social publishing payloads after validation. Fixes X/Twitter, LinkedIn, and Xiaohongshu posts, preserves intent, removes risky terms or links when possible, and returns corrected JSON, fixed rule codes, remaining risks, and diff so agents can retry safely.

This endpoint speaks x402: an unpaid request returns HTTP 402 with machine-readable payment terms, your agent pays the $0.006 USDC in USDC on-chain, and retries automatically. Pays to 0x118FaE85e5E44a92a1A2b3ED1F16DF3ecAB4Ce58.

Call it in 30 seconds

JavaScriptPythoncurl
// npm i x402-fetch viem
import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";

const account = privateKeyToAccount(process.env.PRIVATE_KEY); // funds USDC on Base
const wallet = createWalletClient({ account, chain: base, transport: http() });
const fetchWithPay = wrapFetchWithPayment(fetch, wallet);

// Pays the $0.006 USDC automatically on the 402, then returns the real response:
const res = await fetchWithPay("https://api-production-853c.up.railway.app/v1/repair", { method: "POST" });
console.log(await res.json());
# pip install x402 eth-account httpx
import os, asyncio
from eth_account import Account
from x402.clients.httpx import x402HttpxClient

account = Account.from_key(os.environ["PRIVATE_KEY"])  # funds USDC on Base

async def main():
    async with x402HttpxClient(account=account) as client:
        # x402 handles the 402 -> pay ($0.006 USDC) -> retry automatically
        r = await client.get("https://api-production-853c.up.railway.app/v1/repair")
        print((await r.aread()).decode())

asyncio.run(main())
# 1) An unpaid request returns HTTP 402 with the exact payment terms:
curl -i -X POST "https://api-production-853c.up.railway.app/v1/repair" \
  -H 'content-type: application/json' \
  -d '{"hashtags": [], "imageUrls": [], "platform": "xiaohongshu", "preserveIntent": "\u4ecb\u7ecd\u4e00\u4e2a AI \u5de5\u4f5c\u6d41\u5de5\u5177\uff1a\u5148\u6821\u9a8c\u5e73\u53f0\u89c4\u5219\uff0c\u518d\u4fee\u590d\u53d1\u5e03 payload\uff0c\u51cf\u5c11\u8fdd\u89c4\u548c\u8fd4\u5de5\u98ce\u9669\u3002", "text": "\u52a0\u5fae\u4fe1\u67e5\u770b\u8be6\u60c5 https://example.com #AI #\u6548\u7387 #\u81ea\u52a8\u5316 #\u589e\u957f #\u5de5\u5177 #\u8425\u9500 #\u5f15\u6d41 #\u901f\u6210 #\u526f\u4e1a #\u7206\u6b3e #\u8fd0\u8425", "title": "\u8fd9\u662f\u4e00\u4e2a\u660e\u663e\u8d85\u8fc7\u4e8c\u5341\u4e2a\u5b57\u7684\u5c0f\u7ea2\u4e66\u7206\u6b3e\u6807\u9898\u6848\u4f8b"}'

# 2) Paying + retrying requires an x402 client that can sign the USDC
#    authorization (curl alone cannot). See the JS / Python tabs below.

New to x402? Read the 5-minute quickstart →

ad slot · a crypto-native, no-tracking ad loads here in production
Query this registry programmatically. Every service here is searchable through the x402hub API, an x402-payable endpoint your agents call and pay per request in USDC.
https://api-service-sandy.vercel.app · GET /api/search?q=... · $0.002 / call
Prefer to just support the project? Tip USDC on Base to 0x40BbeB1BEd1D4ba6f1d4C0eE0C9D93e2dA3347C6. This hub is free and ad-light.