🎓 All Courses | 📚 OpenAI API University Syllabus
Stickipedia University
📋 Study this course on TaskLoco

The Chat Completions API is the foundation of almost every OpenAI application — it takes a list of messages and returns a response.

Message Roles

  • system: Instructions that define the model's behavior
  • user: Input from the human
  • assistant: Previous responses from the model (for conversation history)

Full Example

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful Python tutor."},
        {"role": "user", "content": "What is a decorator?"}
    ],
    temperature=0.7,
    max_tokens=500
)

YouTube • Top 10
OpenAI API University: Chat Completions — The Core API
Tap to Watch ›
📸
Google Images • Top 10
OpenAI API University: Chat Completions — The Core API
Tap to View ›

Reference:

Chat completions API reference

image for linkhttps://en.wikipedia.org/wiki/Special:Search?search=Chat%20Completions

📚 OpenAI API University — Full Course Syllabus
📋 Study this course on TaskLoco

TaskLoco™ — The Sticky Note GOAT