{"marketplace":"Mahshar","description":"AI-powered API marketplace with USDC nanopayments via x402 on Arc Testnet and Arc Mainnet","network":"eip155:5042002","networks":[{"network":"eip155:5042002","label":"Arc Testnet","chainId":5042002,"usdc_asset":"0x3600000000000000000000000000000000000000","payment_domain":{"name":"GatewayWalletBatched","version":"1","chainId":5042002,"verifyingContract":"0x0077777d7EBA4688BDeF3E311b846F25870A19B9"},"gateway_api":"https://gateway-api-testnet.circle.com"},{"network":"eip155:5042","label":"Arc Mainnet","chainId":5042,"usdc_asset":"0x3600000000000000000000000000000000000000","payment_domain":{"name":"GatewayWalletBatched","version":"1","chainId":5042,"verifyingContract":"0x77777777Dcc4d5A8B6E418Fd04D8997ef11000eE"},"gateway_api":"https://gateway-api.circle.com"}],"network_note":"Every 402 response `accepts` array offers BOTH networks above. Pick the entry that matches the chain your Circle Gateway balance is on; sign against that entry's payment_domain. The scalar `network`, `payment_domain`, and `usdc_asset` fields on this response describe Arc Testnet only and remain for backward compatibility.","payment_protocol":"x402","prerequisite":"USDC must be pre-deposited into the Circle Gateway (https://gateway-api-testnet.circle.com) before making payments. A raw EOA USDC balance on Arc testnet is not accepted — the facilitator checks Circle Gateway balance, not the token contract. Use the Circle CLI (`circle gateway deposit`) or the cross-chain bridge flow on the Mahshar buyer dashboard to fund your Gateway balance.","payment_domain":{"name":"GatewayWalletBatched","version":"1","chainId":5042002,"verifyingContract":"0x0077777d7EBA4688BDeF3E311b846F25870A19B9"},"proxy_urls":{"envelope":"https://mahshar.xyz/api/proxy","envelope_note":"POST body carries {api_id, buyer_wallet, method?, path?, body?}. The inner `body` is forwarded upstream. Used by the browser client.","path_template":"https://mahshar.xyz/api/proxy/{api_id}","path_note":"POST or GET. The entire request body is forwarded to the seller's endpoint as-is (no envelope). Buyer identity is the settled payment signer. This is the format Circle Agent Stack's `circle_pay_service` tool speaks natively.","circle_agent_stack_compatible":true},"eip712_types":{"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"usdc_asset":"0x3600000000000000000000000000000000000000","amount_decimals":6,"amount_note":"The `amount` field in the 402 PAYMENT-REQUIRED response is in micro-USDC (6 decimal places, matching the USDC token contract). Example: \"1100000\" = $1.10 USDC. The buyer-facing amount already includes a 10% platform fee on top of the listed price_per_call_usdc. Pass it as BigInt when constructing the EIP-712 message value field.","nonce_format":"bytes32 — 32 cryptographically random bytes, hex-encoded with a 0x prefix. Generate with: crypto.getRandomValues(new Uint8Array(32)) then hex-encode. Each payment must use a unique nonce; reuse will cause settlement failure.","validity_window":{"validAfter":"Unix timestamp (seconds) before which the authorization is not valid. Recommended: Math.floor(Date.now() / 1000) - 600 to allow 10 minutes of clock-skew grace.","validBefore":"Unix timestamp (seconds) after which the authorization expires. Recommended: Math.floor(Date.now() / 1000) + 604900 (~7 days). Must be passed as BigInt in the EIP-712 message."},"how_to_pay":"Step 1: POST to /api/proxy/{api_id} (path route, recommended) with the upstream API's body as-is, no Payment-Signature header. Or use POST /api/proxy with an envelope body {api_id, buyer_wallet, body}. Step 2: You will receive a 402 with a base64-encoded PAYMENT-REQUIRED header. Decode it (base64 → JSON) — `accepts` is an ARRAY offering both Arc Testnet (eip155:5042002) and Arc Mainnet (eip155:5042). Pick the entry that matches the chain your Circle Gateway balance is on. Step 3: Construct a TransferWithAuthorization EIP-712 message using the picked entry's `extra.verifyingContract` and its `network`'s chainId (see `networks` on this response), eip712_types, and the values from the picked entry (amount, payTo, asset). Sign it with signTypedData (EIP-712). Step 4: Build the payment payload per payment_signature_schema and base64-encode it. Step 5: Retry the identical request (URL + body) with a Payment-Signature header set to that base64 string.","payment_signature_schema":{"note":"Construct this object, JSON.stringify it, base64-encode the result, and send as the Payment-Signature request header.","shape":{"x402Version":2,"payload":{"authorization":{"from":"<buyer wallet address — 0x-prefixed checksummed address>","to":"<payTo from your chosen accepts entry>","value":"<amount from your chosen accepts entry as a decimal string — micro-USDC, 6-decimal integer>","validAfter":"<Unix timestamp as decimal string, e.g. \"1234567890\">","validBefore":"<Unix timestamp as decimal string, e.g. \"1235172790\">","nonce":"<bytes32 hex string with 0x prefix>"},"signature":"<0x-prefixed EIP-712 signature returned by signTypedData>"},"resource":"<the resource object from the 402 PAYMENT-REQUIRED response>","accepted":"<the full accepts entry you signed against (the one matching your chain)>"}},"examples":{"curl_probe_402":"curl -s -i -X POST https://mahshar.xyz/api/proxy/34c7a931-81de-4b8b-81ac-0916b4316989 -H 'content-type: application/json' -d '{\"address\":\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\"chain\":\"arc\"}'","curl_decode_accepts":"curl -s -X POST https://mahshar.xyz/api/proxy/34c7a931-81de-4b8b-81ac-0916b4316989 -H 'content-type: application/json' -d '{\"address\":\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\"chain\":\"arc\"}' -D - -o /dev/null | awk 'BEGIN{IGNORECASE=1} /^payment-required:/{sub(/^[^:]+: /, \"\"); print}' | tr -d '\\r' | base64 -d | jq .","note":"Both examples target the ioscope listing. First returns HTTP 402 with the PAYMENT-REQUIRED header; second decodes the header to show the multi-chain accepts array."},"error_responses":{"403":"API is not active","404":"API not found or inactive","500":"Internal processing error","402_no_payment":"No Payment-Signature header was sent — the PAYMENT-REQUIRED response header contains base64-encoded payment instructions. This 402 has an empty JSON body {}.","402_payment_failed":"A Payment-Signature header was present but verification or settlement failed — check the JSON error field in the body. Common causes: invalid signature, wrong amount, reused nonce, insufficient Circle Gateway balance, or `duplicate_payment` if the tx_hash is a replay of a previously settled payment."},"apis":[{"id":"34c7a931-81de-4b8b-81ac-0916b4316989","name":"Ioscope Wallet Risk Scoring","description":"Wallet risk scoring and behavioral analysis for Arc, Base, and Soneium chains. POST an address and chain, get back a risk score, bot probability, AI classification (whale, developer, bot, etc.), transaction metrics, and detected patterns like MEV, honeypot, and bridge activity.","category":"Finance","price_per_call_usdc":1.2,"payment_model":"pay-per-call","auth_type":"public","score":6,"verified":false,"example_request":"{\"address\": \"0x1234567890123456789012345678901234567890\", \"chain\": \"arc\"}","example_response":{"riskScore":23,"botProbability":0.05,"aiAnalysis":{"classification":"defi_power_user"},"metrics":{"txCount":142,"totalVolumeIn":"1500.00"}},"total_calls":73,"success_rate":0.86,"avg_latency_ms":3016,"proxy_url":"https://mahshar.xyz/api/proxy/34c7a931-81de-4b8b-81ac-0916b4316989"}]}