Code Converter

Translate code into another programming language, written the way that language is normally written.

Pay by wallet (x402) AI-generated code-convert

Example

Input
{
  "code": "function hello() { return 'world'; }",
  "to_language": "en",
  "from_language": "en"
}
Answer
{
  "confidence": "high",
  "converted_code": "function hello() { return 'world'; }",
  "source_language": "en",
  "target_language": "en",
  "conversion_notes": [
    "Source and target languages are identical; no conversion needed"
  ],
  "dependencies_needed": []
}

Inputs

FieldTypeRequiredWhat it is
codestringYes—
to_languagestringYes—
from_languagestringNo—

Output fields

How reliably each field appears in a successful answer.

FieldTypeAppears
confidencestringAlways (present in every successful answer)
converted_codestringAlways (present in every successful answer)
source_languagestringAlways (present in every successful answer)
target_languagestringAlways (present in every successful answer)
dependencies_neededarrayAlways (present in every successful answer)

How to call it

The same tool through each route. MCP clients reach it through Strale’s server at https://api.strale.io/mcp; the call below is what the agent sends.

# Needs an API key. max_price_cents caps what this call may cost.
curl -X POST https://api.strale.io/v1/do \
  -H "Authorization: Bearer $STRALE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "capability_slug": "code-convert",
    "inputs": {
      "code": "function hello() { return 'world'; }",
      "to_language": "en",
      "from_language": "en"
    },
    "max_price_cents": 5
  }'

Limitations

  • Converted code can need manual adjustment

    AI-powered code conversion — language-specific idioms, standard library differences, and edge cases may require manual adjustment

    What to do instead: Run the converted code through the target language's linter and test suite before using in production