{"uid":"cap_PBNhSyRKx1uj3FDInAAUd","slug":"api-strale-io-59ff2d29","name":"HTTP Request to cURL & Fetch/Axios Code Converter","description":"Convert HTTP request parameters to curl command + equivalent fetch/axios code. Supports auth, headers, body. Algorithmic.","url":"https://api.strale.io/x402/http-to-curl","method":"GET","headers":{},"bodySchema":{"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":["url"],"properties":{"url":{"type":"string"},"auth":{"type":"object"},"body":{},"method":{"type":"string"},"headers":{"type":"object"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"url":"https://api.example.com/users","body":"","method":"GET","headers":{"Content-Type":"application/json","Authorization":"Bearer abc123"}},"response":{"url":"https://api.example.com/users","_meta":{"payment":{"method":"x402","price_usd":0.0216,"settlement_id":"0xadf78f35bc2f3acde5c40727759a470bd2ff4f8b319bfe8fc2d2c47e104baa03"},"capability":"http-to-curl","latency_ms":0,"provenance":{"source":"algorithmic","fetched_at":"2026-06-13T04:24:58.185Z"}},"method":"GET","curl_command":"curl \\\n  'https://api.example.com/users' \\\n  -H 'Authorization: Bearer abc123' \\\n  -H 'Content-Type: application/json'","equivalent_axios":"const response = await axios.get(\"https://api.example.com/users\", {\n  headers: {\"Authorization\":\"Bearer abc123\",\"Content-Type\":\"application/json\"},\n});","equivalent_fetch":"const response = await fetch(\"https://api.example.com/users\", {\n  headers: {\n      \"Authorization\": \"Bearer abc123\",\n      \"Content-Type\": \"application/json\"\n  },\n});"}},"exampleRequest":{"url":"https://api.example.com/users","body":"","method":"GET","headers":{"Content-Type":"application/json","Authorization":"Bearer abc123"}},"tags":["x402"],"displayCostAmount":"0.0216","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0216/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0216","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0216","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_MfX1rHVQ_-LJhWhjjA_CJ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0216","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts HTTP request parameters (method, URL, headers, auth, body) into an equivalent curl command and fetch/axios code snippets","exampleAgentPrompt":"Convert this GET request to a curl command and fetch/axios code: URL is https://api.example.com/users, with an Authorization header of 'Bearer abc123' and query params limit=10 and page=2.","exampleUseCases":null,"resultDescription":"Returns the equivalent curl command string along with JavaScript fetch and axios code snippets for the given HTTP request, including all specified headers, authentication, query parameters, and body.","failureModes":["Missing required 'input' or 'method' field returns a validation error","Unsupported HTTP method (e.g. POST, PUT) rejected — only GET, HEAD, DELETE are accepted","Missing URL in queryParams results in an incomplete or error response","Malformed auth object may cause partial output or error","Payment not processed or insufficient USDC balance results in 402 response"],"whenToPreferThis":"Use this endpoint when you need to algorithmically and reliably convert a structured HTTP request definition into curl, fetch, and axios code without relying on an LLM to generate the syntax. Ideal for developer tooling, documentation generation, onboarding flows, or any scenario where reproducible, exact code output is required for GET, HEAD, or DELETE requests.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T06:40:27.245Z","isFirstParty":false}