OpenAI API Basics - Keys, a First Request, Streaming and Errors
Send your first request to the OpenAI API with the key kept out of your code, then add streaming, retries and sensible error handling.
The OpenAI API lets your own software use the same family of models behind ChatGPT. It is also the pattern many other providers copy, so learning it pays off twice. This guide gets you from nothing to a working, safely handled request.
Related guides
Getting Reliable JSON and Structured Output from AI
Techniques for making a model return clean JSON every time, from prompt wording and schemas to validation and retry loops in your code.
6 min read
Building Your First AI Agent, Step by Step
Understand what an agent is, then build a simple one: a goal, a loop, a few tools and clear stopping rules, with a framework-free Python sketch.
7 min read
Getting Started with ChatGPT: A Practical First Week
Set up ChatGPT from OpenAI, learn its main features such as custom instructions, memory and custom GPTs, and build useful habits in your first week.
5 min read