ai_code_translate
Code translator — Translate source code between programming languages (Python, JavaScript, TypeScript, Go, Rust, Java, C#, Ruby, PHP, Bash and more) into idiomatic target code, keeping behavior and names. Params: code (required, URL-encoded, max 6000 chars), to (required target language), from (optional). Returns plain code, no markdown. Llama 3.3 70B on Workers AI. Price: $0.01 USDC (Base, via x402).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>",
"to": "<to>"
},
"name": "ai_code_translate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | go | |
| code | Yes | def add(a, b): return a + b |