# PrimeAPI AI Code Converter

> PrimeAPI AI Code Converter is a paid API for AI agents from prime-api-seven.vercel.app, paid per call via x402, $0.132056/call, status unknown (last checked 2026-09-14).

Converts code from one programming language or format to another using AI

## Facts

- Endpoint: POST https://prime-api-seven.vercel.app/api/ai/code/convert
- Price: $0.132056/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/primeapi-ai-code-converter-ab7fcdb4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xS3RHDpkTQ6pVyRJd0dq0

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 primeapi-ai-code-converter-ab7fcdb4 -d '<json body>'
```

Example prompt: Can you convert this Python function to TypeScript for me: 'def add(a, b): return a + b'?

## When to prefer this

Use this endpoint when you need to quickly transpile or translate code snippets between programming languages without setting up API keys, paying per call in USDC on Base. Suitable for lightweight code conversion tasks embedded in agent workflows.

## Known failure modes

- Ambiguous or missing source/target language results in generic or incorrect output
- Unsupported language pair may return empty or error response
- Complex or context-dependent code may be partially converted with loss of logic
- Payment failure (402) if USDC balance is insufficient
- Vague query string may return low-quality or hallucinated code

## How this service works

Crypto, AI, Social Media, Finance, Weather, Tools &amp; more. Pay per call in USDC on Base. No API keys.

## Output

Returns an object containing the AI-converted code in the target language, along with any relevant notes or metadata about the conversion.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "description": "Search query or input parameter"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "description": "API response data"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/primeapi-ai-code-converter-ab7fcdb4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from prime-api-seven.vercel.app](https://www.zero.xyz/host/prime-api-seven.vercel.app/llms.txt)
