OpenAI has several overlapping APIs and many outdated tutorials; knowing which is current saves you from building on a dead end.
The OpenAI API lets your own program use OpenAI's models, the same family behind ChatGPT. Your code sends a request over the internet and gets a response back, and you pay per token used.
Over the years OpenAI shipped several ways to talk to its models. In October 2026 the picture is:
- Responses API (
client.responses.create): the recommended interface for all new projects. One call can produce text, use built-in tools such as web search, call your functions, and optionally keep conversation state on OpenAI's side. - Chat Completions (
client.chat.completions.create): the older interface. It is still supported and you will see it everywhere online, but new features land in Responses first. - Assistants API: retired. It was shut down on 26 August 2026; its threads and runs were replaced by the Responses and Conversations APIs.
- Agents SDK: a separate Python library (
openai-agents) for building agents in your own app. - Agents API (beta): a hosted service where OpenAI runs a long-lived agent for you.
This course uses the Responses API through the official Python SDK, the openai package. Everything else (tools, agents, batch jobs) builds on it.
The docs now live at developers.openai.com/api/docs, and keys are managed in the dashboard at platform.openai.com. Models and features change every few months, so check the docs and the deprecations page instead of trusting old blog posts.
Example
# Which API does a snippet use? Look at the call:
#
# client.responses.create(...) -> Responses API (use this)
# client.chat.completions.create(...) -> Chat Completions (older, supported)
# client.beta.threads / assistants ... -> Assistants API (shut down Aug 2026)
# from agents import Agent, Runner -> Agents SDK (openai-agents package)Remember
- Start new work on the Responses API
- Chat Completions still works; the Assistants API is gone
- Docs: developers.openai.com/api/docs; keys: platform.openai.com
Watch out for
- Copying an Assistants API tutorial (threads, runs); that API no longer exists.