Prompt to cURL

Paste a prompt; get a complete cURL command for OpenAI / Anthropic / Gemini / DeepSeek. Useful for one-off API testing from the terminal or for copy-paste into provider documentation.

How to use the Prompt to cURL

Pick provider, set model, paste prompts. Output uses environment variables for API keys ($OPENAI_API_KEY, $ANTHROPIC_API_KEY, etc.) — set the var in your shell first, then paste the command.

Testing a prompt from the terminal

When you just want to fire a prompt at an API to see what comes back, a cURL command is the quickest path — no project, no SDK install, just one line in the terminal. But each provider has its own endpoint, headers, and request body shape, so writing that command from memory is easy to get wrong.

This tool builds a complete, correct cURL command for OpenAI, Anthropic, Gemini, or DeepSeek from your model and prompt. The API key is referenced as an environment variable rather than pasted inline, so you can copy the command without baking a secret into your shell history. For a runnable script instead, see the Python and JavaScript generators.

Common use cases

  • One-off testing — hit an API from the terminal without writing any code.
  • Endpoint reference — get the correct URL, headers, and body for a provider.
  • Debugging — reproduce a request outside your app to isolate an issue.
  • Docs and bug reports — paste a runnable cURL example others can try.
  • Cross-provider checks — compare the same prompt against several APIs quickly.

Frequently asked questions

Which providers are supported?

OpenAI, Anthropic, Gemini, and DeepSeek. Each gets its correct endpoint, authentication header, and request body shape.

Is my API key put in the command?

No. The command references an environment variable such as $OPENAI_API_KEY, so set that in your shell first and the key never appears in the copied text.

Can I get a script instead of cURL?

Yes — the prompt to Python and prompt to JavaScript tools wrap the same request in a runnable SDK script.

Does it send the request for me?

No. It only builds the command text; you run it in your own terminal, so nothing is sent from this page.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: