# Code Language Converter

> Code Language Converter is a paid API for AI agents from api.strale.io, paid per call via x402, $0.054001/call, status unknown (last checked 2026-09-14).

Converts source code from one programming language to another using idiomatic patterns for the target language

## Facts

- Endpoint: POST https://api.strale.io/x402/code-convert
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-cf19bc65
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__BaAQt4_d6Cpn_oXSdYnf

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-strale-io-cf19bc65 -d '<json body>'
```

Example prompt: Convert this Python function to idiomatic Go for me: 'def add(a, b): return a + b'

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Convert code between programming languages. Uses idiomatic patterns for the target language. Supports all major languages.

## Output

Returns the converted source code rewritten in the target programming language using idiomatic patterns and conventions native to that language

## Example request

```json
{
 "code": "def add(a, b):\n    return a + b",
 "to_language": "JavaScript",
 "from_language": "Python"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "code": {
   "type": "string"
  },
  "to_language": {
   "type": "string"
  },
  "from_language": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-cf19bc65/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.strale.io](https://www.zero.xyz/host/api.strale.io/llms.txt)
