{"uid":"cap_akWQfv-akvIf5Q7wi-KZd","slug":"hermes-micro-agent-code-refactor-0945dbf0","name":"Hermes Micro-Agent – Code Refactor","description":"20 paid AI and data micro-tasks over HTTP 402 on Base (USDC): summarize, extract, keywords, sentiment, translate, rewrite, proofread, python_debug, code_lint, code_explain, code_refactor, code_review, json_minify, json_query, csv_to_json, hash, base64, convert, describe_image, probe_media. Each call is priced per-task and verified on-chain before execution.","url":"https://92.5.95.177.sslip.io/code_refactor?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["prompt"],"properties":{"task":{"type":"string","description":"Which micro-task to run"},"input":{"type":"string","description":"Alias for prompt"},"prompt":{"type":"string","description":"Text to process"}}},"responseSchema":{"type":"string"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.25","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.25/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_YZPiqxMcpsQxEnkTU84XN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.25","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Refactors submitted code to improve structure, readability, or efficiency using an AI micro-task billed at $0.25 USDC per call via HTTP 402 on Base.","exampleAgentPrompt":"Can you refactor this Python function to be cleaner and follow best practices? Here's the code: `def calc(x,y,z): return x*y+z/x-y`","exampleUseCases":[{"title":"Legacy code cleanup sprint","prompt":"I have this old JavaScript function that works but is really hard to read — can you refactor it to be cleaner and more maintainable? Here it is: `function d(a,b){var c=a+b;if(c>10){return c*2}else{return c}}`"},{"title":"Pre-review code polish","prompt":"Before I submit this pull request, can you refactor my Python class to improve its structure and follow proper object-oriented conventions? The code is: `class mgr: def __init__(self,d): self.d=d; def get(self,k): return self.d[k] if k in self.d else None`"},{"title":"Reducing code duplication","prompt":"I've got a bunch of repeated logic in this TypeScript snippet — can you refactor it to eliminate the duplication and make it DRY? Here it is: `function addTax(p){return p+(p*0.2)} function addDiscount(p){return p-(p*0.1)} function finalPrice(p){return p+(p*0.2)-(p*0.1)}`"}],"resultDescription":"A plain string containing the refactored version of the submitted code, restructured or rewritten by the AI to improve quality, readability, or adherence to best practices — returned after on-chain USDC payment verification.","failureModes":["Payment not verified on-chain — returns HTTP 402 requiring USDC payment before task executes","Empty or missing prompt field — task may return an error or empty string","Ambiguous or language-agnostic code snippet may produce suboptimal refactoring","Very large code inputs may be truncated or produce incomplete results","Network or server unavailability on the raw IP host may cause timeouts"],"whenToPreferThis":"Choose this endpoint when you need a quick, pay-per-use AI code refactoring task without committing to a subscription or managing API keys — ideal for agents that need on-demand code improvement billed transparently in USDC on Base. Prefer it for single-snippet refactoring tasks where cost predictability ($0.25 per call) matters and you want blockchain-verified payment rather than traditional OAuth-gated APIs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T00:33:30.170Z","isFirstParty":false,"canonicalSlug":"hermes-micro-agent-code-refactor-0945dbf0"}