{"uid":"cap__BaAQt4_d6Cpn_oXSdYnf","slug":"api-strale-io-cf19bc65","name":"Code Language Converter","description":"Convert code between programming languages. Uses idiomatic patterns for the target language. Supports all major languages.","url":"https://api.strale.io/x402/code-convert","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"code":{"type":"string"},"to_language":{"type":"string"},"from_language":{"type":"string"}}},"responseSchema":null,"example":{"request":{"code":"def add(a, b):\n    return a + b","to_language":"JavaScript","from_language":"Python"},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.054000000000000006,"settlement_id":"0x1b56c397dabcbac34fca00a8e15e8a2eec4135542b929bf3169276a9753e1eeb"},"capability":"code-convert","latency_ms":1285,"provenance":{"source":"claude-haiku","fetched_at":"2026-06-20T04:16:27.577Z"}},"confidence":"high","converted_code":"const add = (a, b) => a + b;","source_language":"python","target_language":"javascript","conversion_notes":["Used arrow function syntax as idiomatic modern JavaScript","Implicit return for single-expression functions","No type hints in JavaScript; consider using TypeScript for type safety if needed"],"dependencies_needed":[]}},"exampleRequest":{"code":"def add(a, b):\n    return a + b","to_language":"JavaScript","from_language":"Python"},"tags":["x402"],"displayCostAmount":"0.054001","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.054001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.054","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_8REAQgq7qYpGG4nH1LPvK","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.054","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts source code from one programming language to another using idiomatic patterns for the target language","exampleAgentPrompt":"Convert this Python function to idiomatic Go for me: 'def add(a, b): return a + b'","exampleUseCases":null,"resultDescription":"Returns the converted source code rewritten in the target programming language using idiomatic patterns and conventions native to that language","failureModes":["Unsupported language pair — if the source or target language is not among the supported major languages, the API may return an error or empty result","Ambiguous or syntactically broken input code — malformed code may produce incorrect or incomplete translations","Very large code blocks may time out or produce truncated output","Idiomatic translation may not preserve exact runtime behavior for language-specific edge cases"],"whenToPreferThis":"Use this endpoint when you need automatic, idiomatic code conversion between major programming languages — especially when you want the output to follow the conventions and patterns of the target language rather than a literal line-by-line translation. Prefer this over manual rewriting or LLM prompts when you need a consistent, structured API call that accepts well-defined inputs and returns converted code as a service.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:43:13.126Z","isFirstParty":false}