{"uid":"cap_9b6L5wp37QA-6ps148hQN","slug":"statemind-python-code-repair-api-dd658d19","name":"StateMind Python Code Repair API","description":"Return corrected Python for code that fails those checks: the fix is applied and re-checked, and only returned when it holds.","url":"https://api.statemind.ai/v1/x402/repair","method":"POST","headers":{},"bodySchema":null,"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.03","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.03/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.03","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_u41eT4HNcVtFygmmFpuwT","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.03","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Automatically repairs Python code that fails syntax, lint, type, or security checks by applying fixes and re-verifying until the code passes all checks before returning it.","exampleAgentPrompt":"This Python script is failing lint and type checks — can you repair it automatically and give me back a version that passes all the checks?","exampleUseCases":[{"title":"CI pipeline auto-repair step","prompt":"My Python file keeps failing the CI pipeline due to type errors and unsafe constructs — can you repair it and give me back a clean version that passes all the checks?"},{"title":"Fix hardcoded credentials in script","prompt":"I accidentally hardcoded some credentials in this Python script and it's now flagged by the security checker — can you fix it so it passes without those issues?"},{"title":"Clean up student code before submission","prompt":"Here's a student's Python assignment that has syntax errors and lint violations — please repair it automatically so that it passes all the static analysis checks."}],"resultDescription":"Returns corrected Python source code that has been verified to pass all checks (syntax, lint, type safety, security). The fix is applied iteratively and only returned once the repaired code holds under re-checking.","failureModes":["Code repair fails if the underlying errors are too complex or ambiguous to be automatically resolved","Repair loop may not converge if the code has deep architectural issues requiring human judgment","May return an error if the input is not valid Python at all (e.g. wrong language)","Timeout if the re-check loop exceeds iteration limits","Payment failure if USDC balance is insufficient"],"whenToPreferThis":"Choose this endpoint when you need Python code to be automatically fixed AND verified — not just flagged with errors. It is ideal for automated pipelines where you need a guaranteed-passing output without manual intervention. Prefer it over a plain linter or type-checker when you want the corrected code returned, not just a list of problems.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:36:36.707Z","isFirstParty":false}