{"uid":"cap_-NxuFQGqWo6Ba_Akzdcnt","slug":"asterpay-ai-code-review-d6077d46","name":"AsterPay AI Code Review","description":"Trust, discovery, and fiat settlement layer for AI agent commerce. Dual-protocol: accepts both x402 and MPP payments in USDC on Base. EUR/GBP/USD fiat settlement via SEPA Instant.","url":"https://x402.asterpay.io/v1/ai/code-review","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"code":{"type":"string"},"language":{"type":"string"}}},"responseSchema":{"type":"json","example":{"score":7.5,"issues":[{"line":1,"message":"Missing type annotations","severity":"warning","suggestion":"Add TypeScript types"}],"summary":"Clean function with minor improvements suggested."}},"example":{"request":{"input":{"body":{"code":"function calculateSum(numbers) {\n  let total = 0;\n  for (let i = 0; i < numbers.length; i++) {\n    total += numbers[i];\n  }\n  return total;\n}","language":"javascript"},"type":"http","method":"POST","headers":{"Content-Type":"application/json"},"bodyType":"json"}},"response":{"data":{"score":80,"issues":[{"line":1,"message":"Function name could be more descriptive","severity":"info","suggestion":"Consider renaming to 'calculateArraySum' for clarity"},{"line":2,"message":"Variable 'total' could be declared with const","severity":"warning","suggestion":"Use 'let total = 0' only if the variable needs to be reassigned"},{"line":3,"message":"Consider using a more modern loop construct","severity":"info","suggestion":"Use 'for...of' loop or 'Array.prototype.reduce' for better readability"},{"line":1,"message":"Function does not handle non-numeric values","severity":"warning","suggestion":"Add input validation to handle non-numeric values"},{"line":1,"message":"Function does not handle empty input array","severity":"info","suggestion":"Consider adding a check for empty input array"}],"summary":"The code is generally well-structured but could benefit from more descriptive naming, input validation, and modern loop constructs"},"success":true,"timestamp":"2026-06-17T21:38:42.769Z"}},"exampleRequest":{"code":"function calculateSum(numbers) {\n  let total = 0;\n  for (let i = 0; i < numbers.length; i++) {\n    total += numbers[i];\n  }\n  return total;\n}","language":"javascript"},"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NEidrjp36ce4envYCOrrw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Analyzes submitted code and returns a quality score, line-level issues with severity and suggestions, and a human-readable summary","exampleAgentPrompt":"Can you review this function for me and give it a quality score, flag any issues with line numbers and severity, and suggest improvements? Here's the code: `function add(a, b) { return a + b; }`","exampleUseCases":[{"title":"Automated code review for pull requests","prompt":"Before I merge this pull request, can you review the new code changes and give me a quality score? Flag any issues with line numbers and severity levels, and suggest improvements where you see problems. Here's what was added: `function calculateDiscount(price, percent) { const discount = price * percent; return price - discount; }`"},{"title":"Detect bugs and code smells","prompt":"I'm worried there might be some bugs or code smells in this module. Can you analyze it for me, give it a quality score, and walk me through any issues you find with line numbers and severity? Here's the code: `function getUserData(id) { var user = database.query(id); if (user) { return user; } }`"},{"title":"Check code quality before deployment","prompt":"Help me make sure this code is production-ready. Can you review it for quality issues, give me a numeric score, and tell me what needs fixing with line-by-line feedback and suggestions? Here's the function I want to deploy: `async function fetchAndProcess(url) { let response = fetch(url); let data = response.json(); return data.map(x => x.value); }`"}],"resultDescription":"Returns a numeric quality score (e.g. 7.5 out of 10), an array of issues each containing line number, message, severity (e.g. warning/error), and a suggestion, plus a plain-English summary of the overall code quality.","failureModes":["Empty or missing code body returns a 400 validation error","Extremely large code submissions may time out or be rejected","Malformed request body returns a parsing error","Payment not attached or insufficient USDC balance returns a 402 Payment Required","Unsupported language or binary content may produce low-confidence results"],"whenToPreferThis":"Choose this endpoint when you need a per-call, pay-as-you-go code review with line-level granularity and a numeric quality score, especially within an AI agent workflow that handles x402 micropayments in USDC on Base. Prefer it over static linting tools when you want a blended quality score with natural-language suggestions per issue.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:44:12.504Z","isFirstParty":false}