OpenAI API from A to Z
A complete course on the OpenAI API for developers: Chat Completions, model selection (gpt-4o, o1/o3), tokens and cost, structured outputs, vision and audio, Assistants API v2, function calling, streaming, embeddings, and production patterns. Real TypeScript and Python code with current parameter names (2025).
API Basics
Installing the SDK, your first Chat Completions call, choosing a model for the task and budget, counting tokens and cost.
Chat Completions
System messages and sampling, structured outputs with a strict schema, gpt-4o multimodality: vision, Whisper, TTS.
Assistants API v2
Assistants, Threads, Runs; File Search with a vector store; Code Interpreter; combining tools and tool_choice.
Function Calling
Function definitions, parsing and executing tool_calls, parallel calls, designing reliable tool descriptions.
Production
Streaming with AbortController, embeddings and semantic search (pgvector), rate limits, backoff, cost monitoring.