HTTP to cURL
Turn HTTP request details into a curl command, with the same request as fetch and axios code. Handles auth, headers and body.
Pay by wallet (x402)
http-to-curl Example
Input
{
"url": "https://example.com",
"body": "This is a test input for automated capability testing.",
"headers": {
"Content-Type": "application/json"
}
} Answer
{
"url": "https://example.com",
"method": "GET",
"curl_command": "curl \\\n 'https://example.com' \\\n -H 'Content-Type: application/json' \\\n -d 'This is a test input for automated capability testing.'",
"equivalent_axios": "const response = await axios.get(\"https://example.com\", {\n headers: {\"Content-Type\":\"application/json\"},\n data: `This is a test input for automated capability testing.`,\n});",
"equivalent_fetch": "const response = await fetch(\"https://example.com\", {\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: `This is a test input for automated capability testing.`,\n});"
} Inputs
| Field | Type | Required | What it is |
|---|---|---|---|
url | string | Yes | — |
auth | object | No | — |
body | any | No | — |
method | string | No | — |
headers | object | No | — |
Output fields
How reliably each field appears in a successful answer.
| Field | Type | Appears |
|---|---|---|
curl_command | string | Always (present in every successful answer) |
equivalent_axios | string | Always (present in every successful answer) |
equivalent_fetch | string | 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": "http-to-curl",
"inputs": {
"url": "https://example.com",
"body": "This is a test input for automated capability testing.",
"headers": {
"Content-Type": "application/json"
}
},
"max_price_cents": 2
}' {
"tool": "strale_execute",
"arguments": {
"slug": "http-to-curl",
"inputs": {
"url": "https://example.com",
"body": "This is a test input for automated capability testing.",
"headers": {
"Content-Type": "application/json"
}
},
"max_price_cents": 2
}
} import { Strale } from "straleio";
const strale = new Strale({ apiKey: process.env.STRALE_API_KEY! });
const result = await strale.do({
capability_slug: "http-to-curl",
inputs: {
"url": "https://example.com",
"body": "This is a test input for automated capability testing.",
"headers": {
"Content-Type": "application/json"
}
},
max_price_cents: 2,
}); import os
from straleio import Strale, DoRequest
strale = Strale(api_key=os.environ["STRALE_API_KEY"])
result = strale.do(DoRequest(
capability_slug="http-to-curl",
inputs={
"url": "https://example.com",
"body": "This is a test input for automated capability testing.",
"headers": {
"Content-Type": "application/json",
},
},
max_price_cents=2,
)) # 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 -X POST https://api.strale.io/x402/v2/http-to-curl \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com",
"body": "This is a test input for automated capability testing.",
"headers": {
"Content-Type": "application/json"
}
}' Limitations
Binary and multipart requests may need manual adjustment
Converts standard HTTP request formats — binary payloads or multipart uploads may produce simplified curl equivalents
What to do instead: For binary payloads, use the --data-binary flag manually and reference the file path instead of inline content
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