n8n-guide
n8n-guide
N8n community
Chat room
Sign In

Extract cURL information

Tag
Empty
Name
Extract cURL information
•
Documents providing APIs usually provide API endpoints .
◦
This is API documentation provided by OpenAI. https://platform.openai.com/docs/api-reference/chat/create
◦
After finding the content that says cURL, find your API key value and other required input parameters, enter them, and copy them.
curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'
•
Open the HTTP Request node and select Import cURL.
•
Just paste the content you copied.
•
Sometimes some values are missing due to bugs. You can run it and check if all values work properly.
Made with Slashpage