Courses

AI Chat Bot with Vue.js and GPT-4 - Intro to Chat with OpenAI - Your First Request to OpenAI API

In this lesson, we perform the necessary “Hello world” step of any new technology by making our first request to the Open AI Chat API.

If you’re using the VS Code Rest client, here’s the setup for the request if you’d like to quickly copy paste.

POST https://api.openai.com/v1/chat/completions
Content-Type: application/json
Authorization: Bearer {{$dotenv NUXT_OPENAI_API_KEY}}

{
  "model": "gpt-3.5-turbo",
  "messages": [{"role": "user", "content": "Say this is a test!"}],
  "temperature": 0,
  "n": 1
}

Links