Is There A Quickstart Guide For Using CURL?

I am looking at the quick start guide at https://platform.openai.com/docs/quickstart and don’t see CURL as a language option in the code blocks. Is there a version of the quick start guide that lists all API calls via CURL?

Interestingly, when I search openai curl api via Google, the first result is OpenAI API Quickstart (cURL) - which leads to the quick start page with the URL param ?context=curl at the end. This suggests CURL code blocks did exist at one point on the quick start guide.

1 Like

Each of the code blocks have a “code type” selector to the right:

What OpenAI should do is not obfuscate RESTful API calls behind a command line (that has line continuation characters that would not work on Windows), but instead show the JSON body of a request.

Such as I can obtain by running it through ChatGPT:

Here’s the same request broken down for any HTTP client:

  • URL: https://api.openai.com/v1/responses

  • HTTP method: POST

  • Headers:

    • Content-Type: application/json
    • Authorization: Bearer YOUR_OPENAI_API_KEY
  • Body:

{
  "model": "gpt-5",
  "input": [
    {
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "What is in this image?"
        },
        {
          "type": "input_image",
          "image_url": "https://openai-documentation.vercel.app/images/cat_and_otter.png"
        }
      ]
    }
  ]
}

Replace YOUR_OPENAI_API_KEY with your actual API key, and send the POST with those headers and JSON body.

Other documentation is quite terrible, for example, showing structured outputs only by SDK and Pydantic classes, while the API reference has a mishmash of examples - and then finally JSON if there is no library module implementation.

So check the little code toggle, or run it through a helpful AI. CURL ultimately is not enough for programmatic use, especially in terms of streaming SSE events.