# curl-to-code converter

> curl-to-code 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-10-10).

Converts a curl command into equivalent code in TypeScript, Python, Go, Rust, Java, or PHP

## Facts

- Endpoint: GET https://api.strale.io/x402/curl-to-code?utm_source=zero.xyz
- Price: $0.054001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-strale-io-77fe3dd2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yPdehWzW-CXy8qwbCVK6U

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-77fe3dd2
```

Example prompt: Can you convert this curl command to TypeScript for me: `curl -X POST https://api.example.com/data -H 'Content-Type: application/json' -d '{"key":"value"}'`?

## When to prefer this

Use this endpoint when a developer or agent has a curl command (e.g. from API documentation) and needs idiomatic code in a specific programming language without manually translating HTTP methods, headers, and body encoding.

## Known failure modes

- Invalid or malformed curl command returns an error
- Unsupported target language returns validation error
- Missing curl_command query parameter returns 400
- Complex curl flags not supported may produce incomplete output
- Network timeout for very complex commands

## How this service works

Convert a curl command to equivalent code in TypeScript, Python, Go, Rust, Java, or PHP.

## Output

Returns equivalent HTTP client code in the specified target language (TypeScript, Python, Go, Rust, Java, or PHP) that performs the same request as the original curl command, with proper headers, body, and method handling.

## Example request

```json
{
 "curl_command": "curl -X GET https://api.example.com/users -H 'Authorization: Bearer token123' -H 'Content-Type: application/json'",
 "target_language": "TypeScript"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "curl_command"
     ],
     "properties": {
      "curl_command": {
       "type": "string"
      },
      "target_language": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-strale-io-77fe3dd2/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)
