{"uid":"cap_U18JVzfGF3aGvUOGERmmv","slug":"hermes-micro-agent-code-refactor-72feaacf","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://hermesmicroservice.theworkpc.com/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.1","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_i1TOHQ2-ewBffPdLqLXsV","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 paid per-call in USDC over HTTP 402 on Base.","exampleAgentPrompt":"Can you refactor this Python function so it's cleaner and easier to read? Here's the code: def calc(x,y): r=x+y; return r*2","exampleUseCases":[{"title":"Cleaning up legacy spaghetti code","prompt":"I have this old JavaScript function that's hard to follow — can you refactor it to use modern ES6 syntax and make it more readable? Here's the code: function getData(cb){var x=[];for(var i=0;i<arr.length;i++){x.push(arr[i]);}cb(x);}"},{"title":"Applying SOLID principles to a class","prompt":"Can you refactor this Python class to follow the single-responsibility principle? It's doing too many things at once — here's the class definition."},{"title":"Reducing duplication in a helper module","prompt":"This utility file has a lot of repeated logic — can you refactor it to eliminate the duplication and make the shared logic reusable? Here's the full module code."}],"resultDescription":"A plain-text string containing the refactored version of the submitted code, improved for readability, structure, maintainability, or efficiency as guided by the prompt.","failureModes":["Missing or empty prompt field returns an error","Payment not confirmed on-chain causes 402 rejection before execution","Ambiguous or language-less snippet may produce generic or incorrect refactoring","Very large code inputs may be truncated or produce incomplete output","Non-code text submitted as prompt may yield nonsensical results"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, pay-per-call code refactoring step inside an automated pipeline and want on-chain payment verification via HTTP 402 / USDC on Base — especially when you don't want to manage a full LLM integration yourself and just need a single refactor micro-task for $0.25.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T19:05:24.638Z","isFirstParty":false,"canonicalSlug":"hermes-micro-agent-code-refactor-72feaacf"}