cURL to Code
Turn a curl command into TypeScript, Python, Go, Rust, Java or PHP.
Pay by wallet (x402) AI-generated
curl-to-code Example
Input
{
"curl_command": "https://example.com",
"target_language": "en"
} Answer
{
"code": "import requests\n\nresponse = requests.get('https://example.com')\nprint(response.text)",
"notes": [
"This is a basic GET request. Install requests with: pip install requests"
],
"language": "python",
"dependencies_needed": [
"requests"
]
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
curl_command | string | Yes | — |
target_language | string | No | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
code | string | Always (present in every successful answer) |
notes | array | Always (present in every successful answer) |
language | string | Always (present in every successful answer) |
dependencies_needed | array | Always (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": "curl-to-code",
"inputs": {
"curl_command": "https://example.com",
"target_language": "en"
},
"max_price_cents": 5
}' {
"tool": "strale_execute",
"arguments": {
"slug": "curl-to-code",
"inputs": {
"curl_command": "https://example.com",
"target_language": "en"
},
"max_price_cents": 5
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "curl-to-code",
inputs: {
"curl_command": "https://example.com",
"target_language": "en"
},
max_price_cents: 5,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="curl-to-code",
inputs={
"curl_command": "https://example.com",
"target_language": "en",
},
max_price_cents=5,
)) # No account. The first request answers 402 with the price in USDC;
# an x402 client pays it from your wallet and repeats the request.
curl -i 'https://api.strale.io/x402/v2/curl-to-code?curl_command=https%3A%2F%2Fexample.com&target_language=en' Limitations
Less common languages may need more manual correction
Supports conversion to major languages (Python, JavaScript, Go, etc.) — less common languages may have suboptimal output
What to do instead: Review the generated HTTP client code against your project's preferred HTTP library and error handling patterns
Related tools
- Agent Trace Analysis €0.20
- API Docs Generator €0.20
- API Mock Responses €0.05
- Changelog Generator €0.03
- Code Converter €0.05
- Commit Message Generator €0.05