{"uid":"cap_XutQ2CVzd0bcPkjs5YZxP","slug":"fastapi-online-code-translation-cross-language-code-converter-275a46a0","name":"fastapi.online — Code Translation (Cross-Language Code Converter)","description":"Chat, embeddings, OCR, speech-to-text, image editing, image understanding (captioning/Q&amp;A), text-to-speech, translation, writing tools, classification tools, developer tools, local utilities, format/checksum validators, encoding &amp; crypto utilities, date/time calculators, geo/coordinate math, math &amp; finance calculators, novelty tools, and business/social writing generators — 179 endpoints in all, across multiple specialized self-hosted models. Pay per call with crypto — no signup — or get an API key.","url":"https://api.fastapi.online/code-translate","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"code":{"type":"string","maxLength":20000,"minLength":1},"to_language":{"type":"string","maxLength":40,"minLength":1},"from_language":{"type":"string","maxLength":40}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm__EG4ctQN9mLIDgD3-16V_","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Translates source code from one programming language to another using AI inference, preserving logic and structure.","exampleAgentPrompt":"Can you translate this Python function to JavaScript? Here's the code: `def add(a, b): return a + b`","exampleUseCases":[{"title":"Porting Python ML script to JavaScript","prompt":"I have this Python data-processing script I need converted to JavaScript — can you translate it for me? Here's the code: `import numpy as np\\nresult = np.mean([1,2,3,4,5])`"},{"title":"Converting Bash automation to Python","prompt":"Can you take this Bash script and rewrite it in Python? The script is: `#!/bin/bash\\nfor f in *.txt; do echo $f; done`"},{"title":"Migrating legacy Java to Go","prompt":"I need this Java class ported to Go — translate it from Java to Go: `public class Greeter { public String greet(String name) { return \"Hello, \" + name; } }`"}],"resultDescription":"Returns the translated source code in the target programming language, preserving the logic and structure of the original code.","failureModes":["Unsupported language pair may produce poor or garbled output","Code exceeding 20,000 characters will be rejected","Ambiguous or missing from_language may cause incorrect translation","Complex language-specific constructs (e.g. macros, metaprogramming) may not translate accurately","Payment failure or missing credentials returns a 402 error"],"whenToPreferThis":"Choose this endpoint when you need a quick, pay-per-call code translation without signing up for a full service. Ideal for one-off conversions or agent workflows that need to port code snippets between languages programmatically. At $0.002 per call it is cost-effective for high-volume automated translation pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T19:08:14.568Z","isFirstParty":false}