GPT-5 New Developer Features — Tutorial [Jupyter Notebook]
The GPT-5 API does A LOT more than the web platform.
Let me show you.
Check out the video on YouTube
Course Update: My voice is gone…
… after many many hours of filming presentations for these slides.
Excited to bring these to you in September for anyone who has purchased the course on zazencodes.com
Dropping this on zazencodes.com in September for anyone who has purchased the course.
Topics from this week’s video
Introduction
Hands-on demo of new developer features in GPT-5
Features covered: reasoning strength, verbosity, freeform function calling, context-free grammar
Target audience: developers, engineers, AI practitioners
Responses API vs Chat Completions
Old way: Chat Completions endpoint
New way: Responses API
Output accessed through
output_text
Benefits:
Supports passing chain-of-thought between turns
Reduces reasoning tokens → cost savings
Reasoning Strength
Levels: minimal, low, medium (default), high
Minimal reasoning (new in GPT-5)
Useful for simple questions
Example: quantum mechanics test problem
Verbosity Flag
Options: low, medium, high
Controls response length/detail
New feature in GPT-5
Freeform Function Calling
Allows executing tools without strict argument schemas
Example: arbitrary bash command tool
Compared with structured function calling:
Structured requires parameter schema (e.g., horoscope function)
Freeform simplifies tool definitions
Context-Free Grammar (CFG)
Forces model outputs to match specified grammar
Example 1: Regex grammar for phone numbers
Validates output as phone number or “unknown”
Verified output extracted from tool call
Example 2: Emoji-only grammar
Summarize quantum computing in emoji
Output validated as emoji sequence
Example 3: Lark grammar
Generates valid Postgres SQL queries
More expressive than regex, ensures valid database syntax
Use case: contract-like enforcement of acceptable outputs
“Which would have advanced the most at the end of a month,” he posited, “the boy who had made his own jackknife from the ore which he had dug and smelted, reading as much as would be necessary for this—or the boy who had ... received a Rodgers' penknife from his father?”
Henry David Thoreau, Walden (1854)