OpenAI API from A to Z · Lesson 1
SDK install and first call
Install the openai SDK, create a client and make your first call with the Responses API on gpt-6-luna, then the same request with Chat Completions. Parse the response, status and finish_reason, usage, length limits and reasoning effort.
Install
npm install openai
# or for Python
pip install openai
Create a key at platform.openai.com/api-keys and put it in the OPENAI_API_KEY environment variable. Never hardcode the key in your repo.
The rest of this lesson opens after a free sign-up
Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.


