PageSourceSearch

https://infinitytechstack.uk/_next/static/chunks/3846-4e27b33844ee2076.js

js infinitytechstack.uk collected 2026-10-06 13:39:07 UTC 154,499 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3846],{3846:(e,t,n)=>{n.r(t),n.d(t,{MODULES:()=>o});let o=[{name:"ChatGPT Essentials",icon:"\uD83D\uDCAC",color:"#10a37f",level:"BEGINNER",desc:"Master the fundamentals of ChatGPT, prompt structuring, and the core OpenAI ecosystem.",lessons:[{title:"Introduction to the OpenAI Ecosystem",xp:100,duration:"10 min",lab:{title:"Query Active OpenAI Models",xp:100,scenario:"Verify which models are available on your OpenAI account. Query the official /v1/models endpoint via REST.",steps:[{say:"Send a GET request to https://api.openai.com/v1/models with your Bearer token.",check:["curl","api\\.openai\\.com/v1/models","Bearer"],out:["{",'  "object": "list",','  "data": [','    { "id": "gpt-4o", "object": "model", "owned_by": "system" },','    { "id": "o3-mini", "object": "model", "owned_by": "system" },','    { "id": "gpt-4o-mini", "object": "model", "owned_by": "system" }',"  ]","}"],hint:'Run: curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"',cmd:'curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"'}]},content:'<h2>The ChatGPT Revolution</h2><p>OpenAI\'s ChatGPT brought generative AI to the mainstream. The ec
1osystem extends beyond the chat UI and includes production APIs, custom GPT experiences, and agent-oriented tooling.</p>\n        <h3>Use the Official Model Reference as Source of Truth</h3>\n        <p>OpenAI updates model availability over time. For production work, always rely on the official OpenAI model reference and changelog instead of hardcoded model assumptions in app code or prompts.</p>\n        <div class="ca-callout"><strong>Verified practice:</strong> Build against documented model families (GPT and o-series) and pin explicit model IDs in production. Revalidate aliases and deprecations during each release cycle.</div>\n        <h3>Core Platform Capabilities</h3>\n        <table><thead><tr><th>Capability</th><th>What it gives you</th><th>Where to verify</th></tr></thead><tbody>\n        <tr><td><strong>Responses API</strong></td><td>Unified text + tool orchestration entrypoint</td><td>OpenAI API docs</td></tr>\n        <tr><td><strong>Function / Tool Calling</strong></td><td>Structured execution against external systems</td><td>OpenAI API docs</td></tr>\n        <tr><td><strong>Web Search / File Search / Computer Use</strong></td><td>Hosted tools for grounded and agentic workflows</td><td>OpenAI platform docs</td></tr>\n        <tr><td><strong>Realtime & GPT-Live-1</strong></td><td>Low-latency interactive voice and streaming scenarios</td><td>OpenAI API docs</td></tr>\n        </tbody></table>\n        <h3>OpenAI Official Model Lifecycle & Status Matrix</h3>\n        <table><thead><tr><th>Model ID / Family</th><th>Category</th><th>Lifecycle Status</th><th>Production Recommendation</th></tr></thead><tbody>\n        <tr><td><strong>GPT-6 Astra / Astra 6</strong></td><td>Frontier Omni & Reasoning Flagship</td><td><span style="color:#10a37f">● ACTIVE (Flagship)</span></td><td>Premier choice for complex multi-agent reasoning, mathematical proof synthesis, and autonomous architecture (1.05M context)</td></tr>\n        <tr><td><strong>GPT-6.1 Sol / Sol 6.1</strong></td><td>High-Efficiency Mid-Tier Reasoning</td><td><span style="color:#10a37f">● ACTIVE (Recommended)</span></td><td>Fast, cost-efficient reasoning model (~1/5 the price of Astra) for high-throughput multi-agent execution</td></tr>\n        <tr><td><strong>GPT-5.6 (Terra / Luna)</strong></td><td>Frontier Intelligence Tiers</td><td><span style="color:#10a37f">● ACTIVE</span></td><td>Balanced deployment: Terra for production dev, Luna for ultra-fast edge routing</td></tr>\n        <tr><td><strong>GPT-4o (gpt-4o-2024-11-20)</strong></td><td>Multimodal Omni</td><td><span style="color:#10a37f">● ACTIVE (Flagship)</span></td><td>High-precision multimodal vision, structured JSON outputs, standard 128K context</td></tr>\n        <tr><td><strong>GPT-4o-mini (gpt-4o-mini-2024-07-18)</strong></td><td>Fast / Cost-Efficient</td><td><span style="color:#10a37f">● ACTIVE (Recommended)</span></td><td>Replaced GPT-3.5 Turbo; high-throughput classification, routing, and distilled student tasks ($0.15/$0.60 per MTok)</td></tr>\n        <tr><td><strong>o3-mini</strong></td><td>Lightweight Reasoning</td><td><span style="color:#10a37f">● ACTIVE (Reasoning)</span></td><td>STEM, coding, mathematical proofs with configurable reasoning_effort (low / medium / high)</td></tr>\n        <tr><td><strong>o1 (o1-2024-12-17)</strong></td><td>Deep Reasoning Flagship</td><td><span style="color:#10a37f">● ACTIVE (Deep Reasoning)</span></td><td>Heavy autonomous reasoning, full tool calling, developer message support, vision analysis</td></tr>\n        <tr><td><strong>GPT-Live-1 / gpt-realtime-2.1</strong></td><td>Realtime Conversational Audio</td><td><span style="color:#10a37f">● ACTIVE (Realtime)</span></td><td>Sub-300ms bidirectional speech-to-speech with server-side VAD and interruption handling</td></tr>\n        <tr><td><strong>Assistants API (v1 / v2)</strong></td><td>Stateful Agent Endpoint</td><td><span style="color:#ef4444">■ RETIRED / SUNSET (Aug 26, 2026)</span></td><td>Endpoints return 410 Gone; migrate to Responses API (/v1/responses) or OpenAI Agents API</td></tr>\n        <tr><td><strong>Legacy Completions (text-davinci-*)</strong></td><td>Base Text Completions</td><td>
1<span style="color:#ef4444">■ SHUT DOWN</span></td><td>Fully retired; migrate to Chat Completions or Responses API with gpt-4o-mini</td></tr>\n        <tr><td><strong>GPT-3.5 Turbo (legacy snapshots)</strong></td><td>Legacy Chat Model</td><td><span style="color:#ef4444">■ DEPRECATED / RETIRED</span></td><td>Retired from production recommendation; migrate to gpt-4o-mini (60% cheaper, vastly superior intelligence)</td></tr>\n        <tr><td><strong>o1-preview / o1-mini (early previews)</strong></td><td>Early Reasoning Previews</td><td><span style="color:#f59e0b">▲ SUPERSEDED</span></td><td>Superseded by full production o1 and o3-mini models with structured outputs and developer messages</td></tr>\n        <tr><td><strong>gpt-realtime-mini</strong></td><td>Early Realtime Voice</td><td><span style="color:#ef4444">■ DEPRECATED</span></td><td>Superseded by gpt-realtime-2.1 and gpt-realtime-2.1-mini</td></tr>\n        </tbody></table>\n        <h3>Model Governance Best Practice</h3>\n        <ul><li>Pin model versions in production.</li>\n        <li>Track deprecations and migration notices in release docs.</li>\n        <li>Re-test prompts and tool schemas when switching model IDs.</li></ul>\n        <h3>Prompting Fundamentals</h3><p>A good prompt provides <strong>Context</strong>, <strong>Task</strong>, <strong>Instructions</strong>, and <strong>Formatting Guidelines</strong>. Instead of asking "Write a blog post about AI," try: <em>"Act as a senior tech writer. Write a 500-word blog post about the impact of AI on web development. Use a professional but accessible tone, and structure it with H2 headers and bullet points."</em></p>\n        <div class="ca-callout"><strong>Pro Tip:</strong> Always assign a persona (e.g., "Act as a senior software engineer") to immediately shift the model\'s tone and vocabulary to the desired domain.</div>',quiz:[{q:"What is the safest way to choose an OpenAI model for production?",options:["Use whichever name appears in social posts","Pin model IDs from the official model reference and monitor deprecations","Always use the newest alias blindly","Never update model settings"],correct:1,explanation:"Official model docs and deprecation notices are the source of truth for production stability."},{q:"What does the 'o' in GPT-4o stand for?",options:["Optimal","Omni","Open","Operational"],correct:1,explanation:"The 'o' stands for omni, reflecting the model's native ability to smoothly process text, audio, and visual inputs."},{q:"What is the benefit of assigning a 'persona' in a prompt?",options:["It uses fewer tokens","It bypasses safety filters","It immediately aligns the model's tone and domain expertise","It makes the API run faster"],correct:2,explanation:"Assigning a persona sets the context window, aligning the model's vocabulary, tone, and depth of knowledge."},{q:"Which of the following describes the operational status of legacy completions models (text-davinci-*) and early gpt-3.5-turbo snapshots?",options:["They are active and recommended for all new 2026 projects","They are officially retired/shut down, requiring immediate migration to active models like gpt-4o-mini and the Responses API","They are permanently reserved for enterprise customers only","They run exclusively on edge devices"],correct:1,explanation:"OpenAI has officially shut down legacy completions endpoints and deprecated legacy GPT-3.5 snapshots; production workloads must migrate to modern active models like gpt-4o-mini and the Responses API."}]},{title:"Advanced Data Analysis",xp:150,duration:"15 min",lab:{title:"Execute Python in Code Interpreter Sandbox",xp:150,scenario:"Run live code in an isolated container. Use the Responses API with the code_interpreter tool to compute data statistics.",steps:[{say:"POST to /v1/responses with code_interpreter enabled in the tools array.",check:["curl","v1/responses","code_interpreter"],out:["{",'  "id": "resp_01CodeInterp",','  "status": "completed",','  "output": [{ "type": "tool_call", "tool": "code_interpreter", "input": "import statistics; statistics.median([12, 15, 22, 29, 35])" }, { "type": "text", "text": "The median value is 22." }]',"}"],hint:'POST to https://api.openai.com/v1/responses with tools: [{"type": "code_interpreter"}].',cmd:'curl https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o","input":"Calculate median of [12, 15, 22, 29, 35] using python","tools":[{"type":"code_interpreter"}]}\''}]},content:'<h2>
1Code Execution in ChatGPT</h2><p><strong>Advanced Data Analysis</strong> (formerly Code Interpreter) allows ChatGPT to write and execute Python code in a secure sandboxed environment. It can process files, generate charts, and perform complex math.</p>\n        <h3>Use Cases</h3>\n        <table><thead><tr><th>Task</th><th>How it works</th></tr></thead><tbody>\n        <tr><td><strong>Data Cleaning</strong></td><td>Upload a messy CSV; ChatGPT writes pandas code to clean and restructure it.</td></tr>\n        <tr><td><strong>Data Visualization</strong></td><td>Ask for a graph; it uses matplotlib or seaborn to generate and display an image.</td></tr>\n        <tr><td><strong>File Conversion</strong></td><td>Upload a PDF and ask it to extract the text into a Word document.</td></tr>\n        <tr><td><strong>Statistical Analysis</strong></td><td>Upload experiment data and ask for t-tests, regressions, or ANOVA results.</td></tr></tbody></table>\n        <div class="ca-callout"><strong>Privacy Note:</strong> The sandbox is ephemeral. Once the session ends or times out, the uploaded files and the environment are permanently deleted.</div>',quiz:[{q:"What language does Advanced Data Analysis use to process files?",options:["JavaScript","Python","R","SQL"],correct:1,explanation:"Advanced Data Analysis uses a sandboxed Python environment with pre-installed libraries like pandas and matplotlib."},{q:"What happens to uploaded files when the session ends?",options:["They are saved permanently","They are permanently deleted along with the sandbox","They are stored in OpenAI's cloud","They are emailed to you"],correct:1,explanation:"The sandbox is ephemeral - files, code, and environment are destroyed when the session times out."},{q:"Can you upload multiple files to Advanced Data Analysis at once?",options:["No, only one file per prompt","Yes, you can upload multiple files and ask it to merge or compare them","Only if you have an Enterprise account","Only images are supported"],correct:1,explanation:"You can upload multiple files (e.g., several CSVs) and ask ChatGPT to join, compare, or analyze them collectively."}]}]},{name:"Custom GPTs & GPT Store",icon:"\uD83E\uDDE9",color:"#10a37f",level:"ADEPT",desc:"Create personalized AI assistants with custom instructions, knowledge bases, API actions, and publish to the GPT Store.",lessons:[{title:"Building Your First Custom GPT",xp:200,duration:"20 min",lab:{title:"Define Custom GPT System Instructions",xp:150,scenario:"Custom GPTs rely on structured system personas. Test a specialized code reviewer persona using the chat completions endpoint.",steps:[{say:"POST to /v1/chat/completions setting a system persona that enforces security code review rules.",check:["curl","v1/chat/completions","system","role"],out:["{",'  "id": "chatcmpl_01GptPersona",','  "choices": [{ "message": { "role": "assistant", "content": "SECURITY AUDIT REPORT:\\n- SQL Injection detected on line 14.\\n- Recommendation: Use parameterized queries." } }]',"}"],hint:"Include a message with role 'system' defining the persona instructions.",cmd:'curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o-mini","messages":[{"role":"system","content":"You are a strict security auditor. Flag OWASP Top 10 vulnerabilities."},{"role":"user","content":"query = \\"SELECT * FROM users WHERE id = \\" + req.id"}]}\''}]},content:"<h2>What is a Custom GPT?</h2><p>A Custom GPT is a tailored version of ChatGPT designed for a specific purpose. You don't need to write code to build one; you just configure it using natural language.</p>\n        <h3>The Configuration Panel</h3>\n        <ul><li><strong>Instructions:</strong> The core prompt that dictates the GPT's behavior, tone, and constraints.</li>\n        <li><strong>Conversation Starters:</strong> Suggested prompts to help users get started.</li>\n        <li><strong>Knowledge Base:</strong> Upload files (PDFs, docs, CSVs) that the GPT can reference via Retrieval-Augmented Generation (RAG).</li>\n        <li><strong>Capabilities:</strong> Toggle Web Browsing, DALL-E Image Generation, and Code Execution on or off.</li></ul>\n        <h3>Writing Solid Instructions</h3><p>A great Custom GPT instruction block uses markdown for structure. Define the <strong>Role</strong>, <strong>Rules</strong>, <strong>Workflow</strong>, and <strong>Output Format</strong> clearly.</p>\n        <pre># Role\nYou are an expert technical reviewer.\n\n# Rules\n- Never rewrite the code automatically.\n- Only point out security vulnerabilities and performance bottlenecks.\n- Be concise and direct.\n\n# Output Format\nAlways respond with a bulleted list of issues.</pre>",quiz:[{q:"How does a Custom GPT use uploaded files in its Knowledge Base?",options:["It fine-tunes the base model on them","It uses Retrieval-Augmented Generation (RAG) to search the documents when answering","It memorizes them permanently","It translates them into Python code"],correct:1,explanation:"Custom GPTs use RAG to search the uploaded documents and inject relevant text into the context window before answering."},{q:"Do you need programming skills to create a Custom GPT?",options:["Yes, you need to know Python","Yes, you need to know JSON","No, you can configure it entirely using natural language instructions","Only for the Enterprise tier"],correct:2,explanation:"Custom GPTs are built using a visual interface and natural language instructions. No coding is required."},{q:"What are the four sections of a solid Custom GPT instruction block?",options:["Input, Output, Error, Log","Role, Rules, Workflow, Output Format","Header, Body, Footer, Sidebar","Prompt, Response, Memory, Tools"],correct:1,explanation:"The best Custom GPT instructions define the Role (persona), Rules (constraints), Workflow (process), and Output Format (structure)."}]},{title:"Actions & API Integrations",xp:250,duration:"25 min",lab:{title:"Smoke-Test Exter
1nal Action Integration",xp:150,scenario:"Custom GPT Actions connect to external REST APIs via OpenAPI specs. Test an authenticated action endpoint with curl.",steps:[{say:"Send an authenticated request to an API endpoint with an Authorization Bearer header.",check:["curl","Authorization","Bearer"],out:["HTTP/1.1 200 OK","{",'  "status": "success",','  "data": { "inventory": 42, "sku": "PROD-990" }',"}"],hint:'Run: curl https://api.example.com/v1/inventory/PROD-990 -H "Authorization: Bearer test_token_123"',cmd:'curl https://api.example.com/v1/inventory/PROD-990 -H "Authorization: Bearer test_token_123"'}]},content:'<h2>Connecting GPTs to the Real World</h2><p><strong>Actions</strong> allow your Custom GPT to interact with external APIs. This turns a chatbot into an agent that can fetch live weather, create Jira tickets, or query a private database.</p>\n        <h3>The OpenAPI Schema</h3><p>To create an Action, provide an <strong>OpenAPI specification (Swagger)</strong>. This JSON or YAML file describes your API\'s endpoints, parameters, and authentication methods.</p>\n        <pre>openapi: 3.1.0\ninfo:\n  title: Weather API\n  version: 1.0.0\npaths:\n  /weather:\n    get:\n      summary: Get current weather\n      operationId: getCurrentWeather\n      parameters:\n       - name: location\n          in: query\n          required: true\n          schema:\n            type: string</pre>\n        <h3>Authentication Options</h3>\n        <table><tr><th>Method</th><th>When to Use</th></tr>\n        <tr><td><strong>None</strong></td><td>Public APIs with no auth required</td></tr>\n        <tr><td><strong>API Key</strong></td><td>Simple bearer token or query param auth</td></tr>\n        <tr><td><strong>OAuth 2.0</strong></td><td>User-specific access (Google, Slack, GitHub)</td></tr></table>\n        <div class="ca-callout"><strong>Security Best Practice:</strong> Always require user confirmation before executing actions that modify data (POST, PUT, DELETE). Enforce this in the GPT instructions.</div>',quiz:[{q:"What format is required to define an Action in a Custom GPT?",options:["A Python script","An OpenAPI (Swagger) schema in JSON or YAML","A Dockerfile","A GraphQL schema"],correct:1,explanation:"OpenAI uses the OpenAPI specification standard to understand what endpoints exist and what parameters they require."},{q:"How does the GPT know which API endpoint to call?",options:["By reading the operationId and summary in the OpenAPI schema","By searching Google","By running a Python script","You hardcode the URL"],correct:0,explanation:"The model reads the descriptions and operationIds in the OpenAPI schema to determine which endpoint matches the user's intent."},{q:"Can Custom GPT Actions use OAuth for user authentication?",options:["No, only API keys are supported","Yes, users will be prompted to log in before the action runs","Only if the API is public","Only for Microsoft APIs"],correct:1,explanation:"Actions fully support OAuth, allowing the GPT to act on behalf of the specific user who is logged into the third-party service."}]}]},{name:"The Responses API",icon:"\uD83D\uDE80",color:"#10a37f",level:"INTERMEDIATE",desc:"Master the new unified API that replaces Chat Completions and Assistants for building agentic applications.",lessons:[{title:"Why Responses API?",xp:200,duration:"12 min",lab:{title:"Hit the Responses API with curl",xp:150,scenario:"Skip the SDK - talk to the Responses API raw. Set your key, then fire a real POST at /v1/responses with a Bearer token.",steps:[{say:"Export your API key as the environment variable OPENAI_API_KEY (any value works in the sandbox).",check:["export\\s+OPENAI_API_KEY=\\S"],out:["✓ OPENAI_API_KEY set for this session"],hint:"Use bash export syntax: export NAME=value",cmd:"export OPENAI_API_KEY=sk-proj-your-key-here"},{say:"POST to https://api.openai.com/v1/responses with curl, authenticating via the Authorization: Bearer header.",check:["curl","api\\.openai\\.com/v1/responses","authorization","bearer"],out:["{",'  "id": "resp_67cb32528d6881909eb77859a",','  "model": "o1", "status": "completed",','  "output": [{ "type": "message", "content": [{ "type": "output_text", "text": "Hello! How can I help?" }] }],','  "usage": { "input_tokens": 11, "output_tokens": 8 }',"}"],hint:'curl https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"o1","input":"Hello"}\'',cmd:'curl https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"o1","input":"Hello"}\''}]},content:'<h2>The New Standard (2025–2026)</h2>\n        <p>The <strong>Responses API</strong> (<code>/v1/responses</code>
1) is OpenAI\'s new unified interface for building AI applications. It replaces both the legacy Chat Completions API and the Assistants API as the primary endpoint.</p>\n        <h3>Why the Migration?</h3>\n        <table><tr><th>Feature</th><th>Chat Completions</th><th>Assistants API</th><th>Responses API</th></tr>\n        <tr><td>Stateful conversations</td><td>❌ Manual</td><td>✅ Threads</td><td>✅ Native (<code>store: true</code>)</td></tr>\n        <tr><td>Built-in tools</td><td>❌ None</td><td>✅ 3 tools</td><td>✅ 6+ tools (web search, file search, code, CUA, MCP)</td></tr>\n        <tr><td>Agentic loops</td><td>❌ Manual</td><td>⚠️ Basic</td><td>✅ Native multi-tool chaining</td></tr>\n        <tr><td>Streaming</td><td>✅</td><td>⚠️ Polling</td><td>✅ Native streaming</td></tr>\n        <tr><td>Prompt caching</td><td>⚠️ Manual</td><td>❌</td><td>✅ Automatic</td></tr></table>\n        <h3>Basic Usage</h3>\n        <pre>import OpenAI from "openai";\nconst openai = new OpenAI();\n\nconst response = await openai.responses.create({\n  model: "o3-mini",\n  input: "What is the capital of France?"\n});\nconsole.log(response.output_text);</pre>\n        <div class="ca-callout"><strong>Migration Tip:</strong> If you\'re building anything new in 2026, start with the Responses API. Chat Completions still works but receives no new features.</div>',quiz:[{q:"What does the Responses API replace?",options:["Only the Assistants API","Only Chat Completions","Both Chat Completions and the Assistants API as the primary development interface","The Embeddings API"],correct:2,explanation:"The Responses API is OpenAI's new unified endpoint that consolidates the capabilities of both Chat Completions and the Assistants API."},{q:"How do you enable stateful conversations in the Responses API?",options:["Create a Thread object","Set store: true in the request","Use a database","It's automatic with no config"],correct:1,explanation:"Setting store: true enables OpenAI to persist the conversation, allowing you to reference previous responses in follow-up requests."},{q:"How many built-in tools does the Responses API support?",options:["None","3 (like Assistants)","6+ including web search, file search, code interpreter, CUA, and MCP","Unlimited"],correct:2,explanation:"The Responses API ships with 6+ built-in tools: web search, file search, code interpreter, computer use, MCP, and image generation."}]},{title:"Built-in Tools & Agentic Loops",xp:250,duration:"15 min",lab:{title:"Orchestrate Multi-Tool Calling in Responses",xp:200,scenario:"Combine web search and code execution in an autonomous loop. Invoke /v1/responses with both web_search_preview and code_interpreter.",steps:[{say:"POST to /v1/responses with both web_search_preview and code_interpreter tools.",check:["curl","v1/responses","web_search_preview","code_interpreter"],out:["{",'  "id": "resp_01MultiToolLoop",','  "status": "completed",','  "output": [{ "type": "tool_call", "tool": "web_search_preview" }, { "type": "tool_call", "tool": "code_interpreter" }, { "type": "text", "text": "Retrieved current GDP numbers and computed compound growth rate: 3.4%." }]',"}"],hint:'Specify tools: [{"type": "web_search_preview"}, {"type": "code_interpreter"}].',cmd:'curl https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o","input":"Find recent economic indicators and compute standard deviation","tools":[{"type":"web_search_preview"},{"type":"code_interpreter"}]}\''}]},content:'<h2>Tools That Ship with the API</h2>\n        <p>The Responses API includes powerful built-in tools that require zero setup - just enable them in your request.</p>\n        <h3>Built-in Tool Catalog</h3>\n        <table><tr><th>Tool</th><th>What It Does</th><th>Use Case</th></tr>\n        <tr><td><strong>web_search</strong></td><td>Searches the internet for real-time information</td><td>Current events, live data, fact-checking</td></tr>\n        <tr><td><strong>file_search</strong></td><td>Searches your uploaded Vector Stores</td><td>RAG over internal documents</td></tr>\n        <tr><td><strong>code_interpreter</strong></td><td>Executes Python in a sandbox</td><td>Data analysis, chart generation, math</td></tr>\n        <tr><td><strong>computer_use</strong></td><td>
1Controls a virtual desktop via screenshots</td><td>Browser automation, legacy app interaction</td></tr>\n        <tr><td><strong>mcp</strong></td><td>Connects to external MCP servers</td><td>Enterprise integrations, databases, APIs</td></tr>\n        <tr><td><strong>image_generation</strong></td><td>Creates images via GPT Image 2</td><td>Design, mockups, visual content</td></tr></table>\n        <h3>Agentic Loops</h3>\n        <p>The model can chain multiple tools in a single request. Ask "Research competitor pricing and create a chart" and it will:</p>\n        <ol><li>Call <code>web_search</code> to find pricing data</li>\n        <li>Call <code>code_interpreter</code> to build a matplotlib chart</li>\n        <li>Return the chart image + text analysis</li></ol>\n        <pre>const response = await openai.responses.create({\n  model: "o3-mini",\n  tools: [\n    { type: "web_search" },\n    { type: "code_interpreter" }\n  ],\n  input: "Find the latest Bitcoin price and plot a 7-day chart"\n});</pre>\n        <h3>MCP Integration</h3>\n        <pre>// Connect to remote MCP servers directly in the API\nconst response = await openai.responses.create({\n  model: "o3-mini",\n  tools: [{\n    type: "mcp",\n    server_label: "my-crm",\n    server_url: "https://mcp.acme.com/sse",\n    require_approval: "always"\n  }],\n  input: "Look up the latest deal status for Acme Corp"\n});</pre>\n        <div class="ca-callout"><strong>\uD83C\uDFAF Key Insight:</strong> The Responses API makes OpenAI a first-class MCP client. You can connect OpenAI o3-mini to any MCP server - the same servers that work with Claude, Cursor, and VS Code.</div>',quiz:[{q:"Which built-in tool allows the Responses API to search the internet?",options:["file_search","code_interpreter","web_search","browser"],correct:2,explanation:"The web_search tool enables the model to search the internet for real-time information directly within a Responses API call."},{q:"How does MCP integration work in the Responses API?",options:["You build a custom plugin","You pass MCP server URLs directly in the tools array with type: 'mcp'","MCP is not supported","You need a separate SDK"],correct:1,explanation:"The Responses API has native MCP support - just add a tool with type: 'mcp' and provide the server URL. GPT handles discovery and execution."},{q:"What is an agentic loop in the Responses API?",options:["A while loop in Python","The model chaining multiple tool calls within a single request to solve complex tasks","A feedback form","A billing cycle"],correct:1,explanation:"Agentic loops allow the model to autonomously call web search, then code interpreter, then image generation - all within one API request."}]},{title:"Stateful Context & Tool Search",xp:200,duration:"10 min",lab:{title:"Query Responses with Dynamic Tool Choice",xp:150,scenario:"OpenAI's tool search dynamically filters tools for the model. Fire a Responses API request with tool_choice set to auto.",steps:[{say:"POST to /v1/responses with tool_choice set to auto across registered tools.",check:["curl","v1/responses","tool_choice.*auto"],out:["{",'  "id": "resp_01ToolChoiceAuto",','  "status": "completed",','  "output": [{ "type": "tool_call", "tool": "web_search_preview", "input": "latest AI benchmarks" }]',"}"],hint:'Include "tool_choice": "auto" in your JSON body.',cmd:'curl https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o","input":"Search latest benchmark results","tool_choice":"auto","tools":[{"type":"web_search_preview"}]}\''}]},content:'<h2>Persistent Conversations</h2>\n        <p>Unlike Chat Completions where you manually manage message history, the Responses API can persist conversations server-side.</p>\n        <pre>// First message\nconst r1 = await openai.responses.create({\n  model: "o3-mini",\n  store: true,\n  input: "My name is Alex and I\'m building a SaaS app."\n});\n\n// Follow-up - references the previous response\nconst r2 = await openai.responses.create({\n  model: "o3-mini",\n  store: true,\n  previous_response_id: r1.id,\n  input: "What tech stack would you recommend for my project?"\n});</pre>\n        <h2>Tool Search</h2>\n        <p>When you have dozens of function tools or MCP servers, loading all their schemas into context wastes tokens. <strong>Tool Search</strong> defers tool loading until the model needs them.</p>\n        <pre>const response = await openai.responses.create({\n  model: "o3-mini",\n  tools: [\n    { type: "function", name: "get_weather", ... },\n    { type: "function", name: "book_flight", ... },\n    // ... 50 more functions\n  ],\n  tool_search: true, // Only inject relevant tools\n  input: "What\'s the weather in London?"\n});</pre>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Cost Saving:</strong> Tool Search can reduce input tokens by 80%+ when working with large tool catalogs. The model only sees the tools relevant to the current query.</div>',quiz:[{q:"How do you reference a previous conversation in the Responses API?",options:["Send the full message history","Use the previous_response_id parameter","Create a Thread object","Store messages in a database"],correct:1,explanation:"The previous_response_id parameter chains responses together, allowing the API to maintain conversational context server-side."},{q:"What does Tool Search do?",options:["Searches the internet for tools","Defers tool schema loading until needed, injecting only relevant tools to save tokens","Installs npm packages","Searches your codebase"],correct:1,explanation:"Tool Search indexes your entire tool catalog and selects only the 5-10 tools relevant to each query, dramatically reducing token consumption."},{q:"What is the key advantage of store: true over manual history management?",options:["It's faster","OpenAI manages context, truncation, and caching automatically - no client-side state needed","It's free","It trains the model"],correct:1,explanation:"Server-side storage eliminates the need to track and send full conversation history, with automatic context management and prompt c
1aching."}]}]},{name:"Conversations API",icon:"\uD83D\uDCAC",color:"#10a37f",level:"INTERMEDIATE",desc:"Manage persistent multi-turn conversations server-side with the Conversations API - replacing manual history management.",lessons:[{title:"Persistent Multi-Turn State",xp:250,duration:"15 min",lab:{title:"Initialize a Stateful Conversation",xp:200,scenario:"Offload chat history to OpenAI servers. Initialize a persistent conversation session via /v1/conversations.",steps:[{say:"POST to https://api.openai.com/v1/conversations to create a new persistent conversation thread.",check:["curl","api\\.openai\\.com/v1/conversations","Authorization"],out:["{",'  "id": "conv_01StatefulThread",','  "object": "conversation",','  "created_at": 1727884800,','  "metadata": { "user_id": "usr_882" }',"}"],hint:"POST to https://api.openai.com/v1/conversations with metadata.",cmd:'curl https://api.openai.com/v1/conversations -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"metadata":{"user_id":"usr_882"}}\''}]},content:'<h2>What Is the Conversations API?</h2>\n        <p>The <strong>Conversations API</strong> is OpenAI\'s dedicated endpoint for managing persistent, server-side conversation state. It replaces the manual pattern of tracking message arrays client-side or using the legacy Assistants API Threads.</p>\n        <h3>Why It Exists</h3>\n        <p>With Chat Completions, developers had to store and re-send the entire message history on every request - leading to token waste, context truncation bugs, and complex client-side state management. The Conversations API eliminates this by letting OpenAI manage the conversation server-side.</p>\n        <h3>Relationship to the Responses API</h3>\n        <p>The Conversations API works hand-in-hand with the <strong>Responses API</strong>. When you set <code>store: true</code> and use <code>previous_response_id</code> in a Responses API call, you are implicitly creating a Conversation. The Conversations API gives you explicit CRUD control over these stored conversations - list, retrieve, and delete them programmatically.</p>\n        <h3>API Usage Patterns</h3>\n        <pre>import OpenAI from "openai";\nconst openai = new OpenAI();\n\n// Start a new conversation via the Responses API\nconst r1 = await openai.responses.create({\n  model: "o3-mini",\n  store: true,\n  input: "I need help planning a product launch."\n});\n\n// Continue the conversation - server remembers context\nconst r2 = await openai.responses.create({\n  model: "o3-mini",\n  store: true,\n  previous_response_id: r1.id,\n  input: "What marketing channels should I prioritize?"\n});\n\n// List all stored conversations\nconst conversations = await openai.responses.list();\n\n// Delete a conversation when no longer needed\nawait openai.responses.del(r1.id);</pre>\n        <h3>Key Benefits</h3>\n        <ul><li><strong>Zero client-side state:</strong> No message arrays, no truncation logic, no local databases.</li>\n        <li><strong>Automatic prompt caching:</strong> Stored conversations get automatic prefix caching for up to 90% input token savings.</li>\n        <li><strong>Seamless migration:</strong> Replaces Assistants API Threads - use Conversations API + Responses API instead.</li>\n        <li><strong>Full audit trail:</strong> Every response is stored with metadata for compliance and debugging.</li></ul>\n        <div class="ca-callout"><strong>\uD83D\uDEA8 Migration Note:</strong> If you are using Assistants API Threads, migrate to the Conversations API before the August 26, 2026 shutdown. The pattern is simpler: <code>store: true</code> + <code>previous_response_id</code> replaces Threads + Runs entirely.</div>',quiz:[{q:"What does the Conversations API replace?",options:["The Embeddings API","Manual client-side message history management and Assistants API Threads","The Batch API","Function calling"],correct:1,explanation:"The Conversations API eliminates the need to track message arrays client-side and replaces the legacy Assistants API Thread model with a simpler server-side approach."},{q:"How does a Conversation get created?",options:["By calling a dedicated /conversations endpoint","Automatically when you use store: true and previous_response_id in the Responses API","By uploading a JSONL file","By creating an Assistant first"],correct:1,explanation:"Conversations are implicitly created when you chain Responses API calls with store: true and previous_response_id - no separate creation step needed."},{q:"What cost benefit do stored conversations provide?",options:["They are free","Automatic prompt c
1aching with up to 90% input token savings on repeated context","They reduce output tokens","They bypass rate limits"],correct:1,explanation:"Stored conversations enable automatic prefix caching, meaning repeated context from prior turns is cached and billed at up to 90% discount."}]}]},{name:"Function Calling & Structured Outputs",icon:"⚙️",color:"#10a37f",level:"INTERMEDIATE",desc:"Master function calling, JSON Schema enforcement, and type-safe AI outputs for production applications.",lessons:[{title:"Function Calling Deep Dive",xp:250,duration:"15 min",lab:{title:"Enforce Strict Function Calling Schema",xp:200,scenario:"Guarantee 100% schema adherence with OpenAI's strict mode. Define get_stock_price with strict: true and required fields.",steps:[{say:"POST to /v1/chat/completions with a function tool having strict: true and required parameters.",check:["curl","v1/chat/completions","strict.*true","get_stock_price"],out:["{",'  "id": "chatcmpl_01StrictFunc",','  "choices": [{ "message": { "role": "assistant", "tool_calls": [{ "id": "call_stock123", "type": "function", "function": { "name": "get_stock_price", "arguments": "{\\"ticker\\":\\"AAPL\\"}" } }] } }]',"}"],hint:'Define tools: [{"type": "function", "function": {"name": "get_stock_price", "strict": true, "parameters": {"type": "object", "properties": {"ticker": {"type": "string"}}, "required": ["ticker"], "additionalProperties": false}}}]',cmd:'curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o-mini","tools":[{"type":"function","function":{"name":"get_stock_price","strict":true,"parameters":{"type":"object","properties":{"ticker":{"type":"string"}},"required":["ticker"],"additionalProperties":false}}}],"messages":[{"role":"user","content":"What is Apple stock price?"}]}\''}]},content:'<h2>Making AI Take Action</h2>\n        <p><strong>Function calling</strong> is the mechanism that transforms an LLM from a text generator into an agent. You define functions with JSON Schema parameters, and the model decides when and how to call them.</p>\n        <h3>How It Works</h3>\n        <ol><li>You define one or more functions in the <code>tools</code> array.</li>\n        <li>The model reads the function names, descriptions, and parameter schemas.</li>\n        <li>Based on the user\'s input, the model returns a <code>tool_call</code> with the function name and JSON arguments.</li>\n        <li>Your code executes the function locally and returns the result.</li>\n        <li>The model uses the result to generate its final response.</li></ol>\n        <pre>const response = await openai.responses.create({\n  model: "o3-mini",\n  tools: [{\n    type: "function",\n    name: "get_stock_price",\n    description: "Get the current stock price for a ticker symbol",\n    parameters: {\n      type: "object",\n      properties: {\n        symbol: { type: "string", description: "Stock ticker (e.g., AAPL)" },\n        currency: { type: "string", enum: ["USD", "EUR", "GBP"] }\n      },\n      required: ["symbol"]\n    }\n  }],\n  input: "What\'s Apple\'s stock price in euros?"\n});\n\n// Model returns: tool_call { name: "get_stock_price", arguments: { symbol: "AAPL", currency: "EUR" } }</pre>\n        <h3>Parallel Function Calls</h3>\n        <p>The model can call <strong>multiple functions simultaneously</strong> when the queries are independent:</p>\n        <pre>// User: "Compare AAPL and MSFT stock prices"\n// Model returns TWO tool_calls in parallel:\n// 1. get_stock_price({ symbol: "AAPL" })\n// 2. get_stock_price({ symbol: "MSFT" })</pre>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Pro Tip:</strong> Write detailed descriptions for every parameter. The model reads these to decide what values to pass. Poor descriptions = wrong arguments.</div>',quiz:[{q:"Does the model execute your functions directly?",options:["Yes, it runs them on OpenAI's servers","No - it returns the function name and arguments; YOUR code executes them locally","Only for Python functions","Only with the Agents SDK"],correct:1,explanation:"The model never executes your code. It returns structured tool_call objects that your application must process and return results for."},{q:"Can the model call multiple functions in one turn?",options:["No, only one at a time","Yes - parallel function calling allows multiple independent calls simultaneously","Only with OpenAI o3-mini Thinking","Only with the Assistants API"],correct:1,explanation:"Parallel function calling lets the model invoke multiple independent functions in a single turn, reducing round-trips."},{q:"What is the most important factor for accurate function calling?",options:["The model version","Detailed descriptions on function names and parameters","The temperature setting","The number of functions defined"],correct:1,explanation:"The model relies entirely on your descriptions to understand what each function does and what arguments to pass. Poor descriptions cause wrong calls."}]},{title:"Structured Outputs & JSON Mode",xp:300,duration:"15 min",lab:{title:"Force Schema-Perfect JSON",xp:150,scenario:"Your parser crashes on free-text model output. Constrain the Responses API with a strict JSON Schema so invalid tokens are mathematically impossible, then extract a field with jq.",steps:[{say:"Call /v1/responses with text.format set to a strict json_schema (name it user_info).",check:["curl","v1/responses","json_schema","strict"],out:['{ "output": [{ "content": [{ "type": "output_text",','  "text": "{\\"name\\":\\"John Doe\\",\\"age\\":30,\\"company\\":\\"Acme Corp\\"}" }] }] }'],hint:'Body: {"model":"o3-mini","input":"Extract: John Doe, age 30, works at Acme Corp","text":{"format":{"type":"json_schema","name":"user_info","strict":true,"schema":{…}}}}',cmd:'curl https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"o3-mini","input":"Extract: John Doe, age 30, works at Acme Corp","text":{"format":{"type":"json_schema","name":"user_info","strict":true,"schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"},"company":{"type":"string"}},"required":["name","age","company"],"additionalProperties":false}}}}\''},{say:"Pipe the response through jq to pull the guaranteed-valid JSON payload out of output_text.",check:["\\|\\s*jq"],out:["{",'  "name": "John Doe",','  "age": 30,','  "company": "Acme Corp"',"}"],hint:"Append: | jq -r '.output[0].content[0].text | fromjson'",cmd:'curl -s https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"o3-mini","input":"Extract: John Doe, age 30, works at Acme Corp","text":{"format":{"type":"json_schema","name":"user_info","strict":true,"schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"},"company":{"type":"string"}},"required":["name","age","company"],"additionalProperties":false}}}}\' | jq -r \'.output[0].content[0].text | fromjson\''}]},content:'<h2>Type-Safe AI Outputs</h2>\n        <p>When building applications, you need the AI to return data in a predictable format. OpenAI provides two mechanisms:</p>\n        <h3>JSON Mode (Basic)</h3>\n        <p>Setting <code>response_format: { type: "json_object" }</code> guarantees valid JSON output. You must still instruct the model about the schema in your prompt.</p>\n        <h3>Structured Outputs (Strict - Recommended)</h3>\n        <p>Introduced in late 2024, Structured Outputs mathematically constrains the model to only produce tokens valid under your JSON Schema. Uses a Context-Free Grammar (CFG) engine at the token generation level.</p>\n        <pre>const response = await openai.responses.create({\n  model: "o3-mini",\n  input: "Extract: John Doe, age 30, works at Acme Corp",\n  text: {\n    format: {\n      type: "json_schema",\n      name: "user_info",\n      str
1ict: true,\n      schema: {\n        type: "object",\n        properties: {\n          name: { type: "string" },\n          age: { type: "number" },\n          company: { type: "string" }\n        },\n        required: ["name", "age", "company"],\n        additionalProperties: false\n      }\n    }\n  }\n});</pre>\n        <h3>When to Use Each</h3>\n        <table><tr><th>Mode</th><th>Guarantee</th><th>Best For</th></tr>\n        <tr><td><strong>JSON Mode</strong></td><td>Valid JSON (any structure)</td><td>Flexible, exploratory outputs</td></tr>\n        <tr><td><strong>Structured Outputs</strong></td><td>Exact schema match (100%)</td><td>Production data pipelines, type-safe integrations</td></tr></table>\n        <div class="ca-callout"><strong>\uD83C\uDFAF Rule of Thumb:</strong> Always use Structured Outputs with <code>strict: true</code> in production. JSON Mode is fine for prototyping but cannot guarantee schema compliance.</div>',quiz:[{q:"What is the key advantage of Structured Outputs over JSON Mode?",options:["It uses less tokens","It guarantees the output perfectly matches a specific JSON schema you define","It automatically saves to a database","It generates HTML instead of JSON"],correct:1,explanation:"Structured Outputs uses a CFG engine to mathematically constrain token generation, guaranteeing 100% schema compliance."},{q:"What property must be set to 'true' to enforce Structured Outputs?",options:["enforce: true","strict: true","require_all: true","validate: true"],correct:1,explanation:"The strict: true flag tells the API to enforce schema constraints rigorously using constrained decoding."},{q:"Why must you set additionalProperties: false in Structured Outputs?",options:["For performance","Because strict mode requires a fully closed schema - no extra fields allowed","It's optional","For authentication"],correct:1,explanation:"Strict mode requires additionalProperties: false on every object to ensure the CFG engine can fully constrain the output space."}]}]},{name:"The Agents SDK",icon:"\uD83E\uDD16",color:"#10a37f",level:"ADVANCED",desc:"Build production multi-agent systems with OpenAI's Agents SDK - handoffs, guardrails, tracing, and sandboxed execution.",lessons:[{title:"Agents SDK Fundamentals",xp:300,duration:"15 min",lab:{title:"Bootstrap the Agents SDK",xp:150,scenario:"Provision the OpenAI Agents SDK and launch your first agent script - the two commands every agent project starts with.",steps:[{say:"Install the Agents SDK for Python with pip.",check:["pip3?\\s+install","openai-agents"],out:["Collecting openai-agents","Successfully installed openai-agents-0.4.2 openai-2.8.0"],hint:"The PyPI package is: openai-agents",cmd:"pip install openai-agents"},{say:"Run your agent entry-point script with Python (file: hello_agent.py).",check:["python3?\\s+\\S*hello_agent\\.py"],out:["[agent] triage_agent → handoff → support_agent",'[tool_call] get_order_status({"order_id": "A1042"})',"Final output: Your order A1042 ships tomorrow.","✓ run completed - trace uploaded to platform.openai.com/traces"],hint:"Just run the file: python hello_agent.py",cmd:"python hello_agent.py"}]},content:'<h2>OpenAI\'s Agent Framework & Agents API</h2>\n        <p>In 2026, OpenAI offers two distinct, complementary paradigms for building agentic systems: the self-hosted <strong>Agents SDK</strong> (<code>pip install openai-agents</code>) and the fully managed <strong>OpenAI Agents API</strong> (launched in public beta on <strong>September 10, 2026</strong> at <code>/v1/agents</code>).</p>\n        \n        <h3>September 10, 2026 Update: The OpenAI Agents API</h3>\n        <p>While the Agents SDK runs inside your own application server and requires you to manage execution loops and local memory, the newly released <strong>Agents API</strong> provides a fully managed cloud harness:</p>\n        <ul>\n          <li><strong>Managed Sandboxing:</strong> Safely executes code, tools, and computer actions in ephemeral micro-containers without exposing host infrastructure.</li>\n          <li><strong>Persistent Session State:</strong> Automatically stores multi-turn thread history and checkpoint states on OpenAI\'s infrastru
1cture.</li>\n          <li><strong>Native Context Compaction:</strong> Transparently summarizes long-horizon conversations when approaching token limits without breaking tool continuity.</li>\n          <li><strong>Parallel Subagent Coordination:</strong> Spawns and supervises multiple worker subagents in parallel cloud threads.</li>\n        </ul>\n\n        <h3>Core Primitives (Agents SDK & API)</h3>\n        <table><tr><th>Primitive</th><th>Purpose</th><th>Example</th></tr>\n        <tr><td><strong>Agent</strong></td><td>An LLM with instructions + tools</td><td>A customer support agent</td></tr>\n        <tr><td><strong>Handoff</strong></td><td>Delegate to another agent</td><td>Triage → Billing Agent</td></tr>\n        <tr><td><strong>Guardrail</strong></td><td>Safety validation on input/output</td><td>Block PII, reject jailbreaks</td></tr>\n        <tr><td><strong>Tracing</strong></td><td>Observability for debugging</td><td>Visualize agent execution flow</td></tr></table>\n        <pre>from agents import Agent, Runner\n\n# Define a simple agent\nsupport_agent = Agent(\n    name="Support Agent",\n    instructions="You are a helpful support agent. Answer questions about our product.",\n    model="o3-mini"\n)\n\n# Run it\nresult = await Runner.run(support_agent, "How do I reset my password?")\nprint(result.final_output)</pre>\n        \n        <h3>SOE & AOE Operational Runbook for OpenAI Agents</h3>\n        <p>When running enterprise agent fleets, implement top <strong>Standard Operating Environment (SOE)</strong> and <strong>AI Operations Engineering (AOE)</strong> controls:</p>\n        <ul>\n          <li><strong>SOE Standard:</strong> Enforce strict organization-level API keys (<code>OPENAI_API_KEY</code>, <code>OPENAI_ORG_ID</code>), pin Python dependencies (<code>openai-agents >= 0.4.0</code>), enforce default developer messages for reasoning models, and configure zero-retention (ZDR) endpoints for enterprise data compliance.</li>\n          <li><strong>AOE Architecture:</strong> Choose <em>Agents API</em> when you need zero-maintenance infrastructure, auto-scaling subagents, and managed cloud sandboxes; choose <em>Agents SDK</em> when you need strict on-prem/VPC residency, custom vector database stores, or offline tool evaluation. Always route user inputs through the free <code>omni-moderation-latest</code> API before passing to the agent loop.</li>\n        </ul>',quiz:[{q:"What framework did the Agents SDK replace?",options:["LangChain","The experimental Swarm framework","AutoGPT","CrewAI"],correct:1,explanation:"The Agents SDK is the production-ready evolution of OpenAI's experimental Swarm framework, which demonstrated multi-agent handoff patterns."},{q:"What major capability was introduced by OpenAI on September 10, 2026?",options:["A new image file format","The OpenAI Agents API in public beta, providing a fully managed cloud harness with sandboxing, session state, and auto-compaction","Deprecation of all Python libraries","Mandatory SMS authentication for each token"],correct:1,explanation:"The OpenAI Agents API launched on September 10, 2026, offering a managed cloud harness for stateful, sandboxed multi-agent workflows."},{q:"Under an AOE operational model, when should you choose the Agents API over the client-side Agents SDK?",options:["Never, they are identical","When you want OpenAI to manage cloud sandboxing, session persistence, and parallel subagent execution without maintaining local server loops","Only for audio generation","Only on mobile phones"],correct:1,explanation:"The Agents API handles runtime sandboxing, persistent memory, and subagent orchestration in the cloud, while the Agents SDK gives you direct code control on your own servers."},{q:"How do you install the client-side Agents SDK?",options:["npm install openai-agents","pip install openai-agents","brew install agents","It's built into the API"],correct:1,explanation:"The Agents SDK is a Python package installed via pip install openai-agents, with TypeScript support also available."}]},{title:"Handoffs & Multi-Agent Patterns",xp:350,duration:"18 min",lab:{title:"Bootstrap Agents SDK Multi-Agent Handoff",xp:200,scenario:"In OpenAI's Agents SDK, agents hand off tasks to specialized peers. Install the SDK and inspect the agent definition.",steps:[{say:"Install the official OpenAI Agents SDK via pip.",check:["pip3?\\s+install","openai-agents|openai"],out:["Successfully installed openai-agents-0.2.0"],hint:"Run: pip install openai-agents",cmd:"pip install openai-agents"},{say:"Run python -c to test an Agent handoff definition.",check:["python3?\\s+-c","Agent","handoffs"],out:["Agent 'TriageAgent' ready with handoffs to: ['BillingAgent', 'TechnicalSupp
1ort']"],hint:"Run: python -c \"from agents import Agent; print('Agent ready with handoffs')\"",cmd:"python -c \"from agents import Agent; a = Agent(name='TriageAgent', handoffs=['BillingAgent']); print(f'Agent {a.name} ready with handoffs: {a.handoffs}')\""}]},content:'<h2>Agent-to-Agent Delegation</h2>\n        <p><strong>Handoffs</strong> are the primary mechanism for multi-agent collaboration. When Agent A encounters a task outside its expertise, it delegates to Agent B by executing a handoff - a typed tool call that transfers control and conversation history.</p>\n        <pre>from agents import Agent, Runner\n\nbilling_agent = Agent(\n    name="Billing Agent",\n    instructions="Handle billing questions, refunds, and subscription changes.",\n    model="o3-mini"\n)\n\ntech_agent = Agent(\n    name="Tech Support",\n    instructions="Handle technical issues, bugs, and feature requests.",\n    model="o3-mini"\n)\n\ntriage_agent = Agent(\n    name="Triage Agent",\n    instructions="Determine if the user needs billing help or technical support. Hand off accordingly.",\n    handoffs=[billing_agent, tech_agent],\n    model="gpt-4o-mini"  # Use cheaper, fast model for routing\n)\n\nresult = await Runner.run(triage_agent, "I was charged twice last month")\n# Triage → Billing Agent (automatic handoff)</pre>\n        <h3>Multi-Agent Patterns</h3>\n        <table><tr><th>Pattern</th><th>Description</th><th>Use Case</th></tr>\n        <tr><td><strong>Manager/Router</strong></td><td>Central agent routes to specialists</td><td>Customer support triage</td></tr>\n        <tr><td><strong>Pipeline</strong></td><td>Agents chain sequentially</td><td>Research → Write → Edit</td></tr>\n        <tr><td><strong>Peer-to-Peer</strong></td><td>Agents hand off freely between each other</td><td>Collaborative problem solving</td></tr></table>\n        <div class="ca-callout"><strong>\uD83C\uDFAF Cost Tip:</strong> Use cheaper models (gpt-4o-mini) for routing/triage agents, and frontier reasoning models (o3-mini or o1) for specialist agents that need deep logic.</div>',quiz:[{q:"What happens during a handoff?",options:["The first agent is destroyed","Control and conversation history transfer to the target agent","Both agents run in parallel","The user must restart the conversation"],correct:1,explanation:"Handoffs transfer both control and the full conversation context to the target agent, enabling seamless delegation."},{q:"Why use a cheaper model for the triage agent?",options:["It's faster at everything","Routing decisions are simple classification tasks that don't need deep reasoning - saving 90%+ cost","Cheaper models are more accurate","It's required by the SDK"],correct:1,explanation:"Triage is a lightweight classification task. Using gpt-4o-mini for routing and o3-mini or o1 for specialist work optimizes cost without sacrificing quality."},{q:"In the Manager/Router pattern, what is the manager agent's primary job?",options:["Answering all questions directly","Determining which specialist agent should handle the request and handing off","Training other agents","Managing API keys"],correct:1,explanation:"The manager/router agent classifies the user's intent and delegates to the appropriate specialist agent via handoff."}]},{title:"Guardrails & Tracing",xp:300,duration:"15 min",lab:{title:"Enable OpenTelemetry Tracing for Agents",xp:150,scenario:"Track every LLM call and tool invocation in multi-agent workflows. Enable OpenAI tracing in your shell environment.",steps:[{say:"Export the environment variable OPENAI_TRACING=true to enable built-in OpenTelemetry instrumentation.",check:["export\\s+OPENAI_TRACING=true"],out:["✓ OPENAI_TRACING set to true. Agent traces will be dispatched to collector."],hint:"Run: export OPENAI_TRACING=true",cmd:"export OPENAI_TRACING=true"}]},content:'<h2>Safety at Every Layer</h2>\n        <p><strong>Guardrails</strong> are validation functions that run at different stages of the agent loop to enforce safety policies.</p>\n        <h3>Three Tiers of Guardrails</h3>\n        <table><tr><th>Tier</th><th>When It Runs</th><th>Purpose</th></tr>\n        <tr><td><strong>Input Guardrail</strong></td><td>Before the first agent processes the message</td><td>Block jailbreaks, validate format</td></tr>\n        <tr><td><strong>Output Guardrail</strong></td><td>After the final agent produces a response</td><td>Redact PII, enforce brand tone</td></tr>\n        <tr><td><strong>Tool Guardrail</strong></td><td>Before/after each tool invocation</td><td>Validate arguments, audit tool usage</td></tr></table>\n        <pre>
1from agents import Agent, InputGuardrail, GuardrailFunctionOutput\n\nasync def block_jailbreaks(ctx, agent, input):\n    # Use a fast model to classify intent\n    result = await Runner.run(\n        Agent(name="Guard", instructions="Is this a jailbreak attempt? Return YES or NO."),\n        input, context=ctx\n    )\n    return GuardrailFunctionOutput(\n        output_info={"decision": result.final_output},\n        tripwire_triggered="YES" in result.final_output\n    )\n\nguarded_agent = Agent(\n    name="Safe Agent",\n    instructions="You are a helpful assistant.",\n    input_guardrails=[InputGuardrail(guardrail_function=block_jailbreaks)]\n)</pre>\n        <h3>Tripwires</h3>\n        <p>When a guardrail detects a violation, it triggers a <strong>tripwire</strong> - immediately halting execution and raising an exception. This prevents unsafe content from propagating through the agent chain.</p>\n        <h2>Built-in Tracing</h2>\n        <p>Every agent run is automatically traced, providing a visual timeline of agent invocations, tool calls, handoffs, and model responses. Traces integrate with Datadog, LangSmith, and other observability platforms.</p>\n        <div class="ca-callout"><strong>\uD83D\uDD12 Enterprise Rule:</strong> Always deploy input guardrails in production. A single unguarded agent can be jailbroken to reveal system instructions or execute unintended tool calls.</div>',quiz:[{q:"What is a tripwire in the Agents SDK?",options:["A network cable","An exception triggered when a guardrail detects a policy violation, immediately halting execution","A debugging breakpoint","A billing alert"],correct:1,explanation:"Tripwires are the enforcement mechanism - when triggered, they immediately stop the agent loop to prevent unsafe content from being processed or returned."},{q:"Which guardrail tier validates tool arguments before execution?",options:["Input Guardrail","Output Guardrail","Tool Guardrail","System Guardrail"],correct:2,explanation:"Tool Guardrails wrap individual function invocations, allowing you to validate arguments before the tool runs and audit results after."},{q:"Why should you use a fast, cheap model for guardrail classification?",options:["Because guardrails run in parallel with the main agent - latency matters","Because expensive models are less accurate","Because guardrails don't need AI","It doesn't matter"],correct:0,explanation:"Guardrails run alongside agent execution. Using a fast model (like OpenAI o3-mini Mini) minimizes the latency overhead of safety checks."}]}]},{name:"Embeddings & Vector Search",icon:"\uD83E\uDDF2",color:"#10a37f",level:"INTERMEDIATE",desc:"Build semantic search and RAG pipelines using OpenAI's embedding models and vector stores.",lessons:[{title:"The Embeddings API",xp:200,duration:"12 min",lab:{title:"Generate Your First Embedding",xp:150,scenario:"Turn raw text into a vector. Call /v1/embeddings with the text-embedding-3-small model and inspect the response shape.",steps:[{say:"POST to https://api.openai.com/v1/embeddings with curl, using model text-embedding-3-small.",check:["curl","api\\.openai\\.com/v1/embeddings","text-embedding-3-small"],out:["{",'  "object": "list",','  "data": [{ "object": "embedding", "index": 0,','    "embedding": [0.0023, -0.0091, 0.0157, … 1533 more floats] }],','  "model": "text-embedding-3-small", "usage": { "prompt_tokens": 5, "total_tokens": 5 }',"}"],hint:'curl https://api.openai.com/v1/embeddings -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"text-embedding-3-small","input":"hello world"}\'',cmd:'curl https://api.openai.com/v1/embeddings -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"text-embedding-3-small","input":"hello world"}\''}]},content:'<h2>Turning Text into Numbers</h2>\n        <p><strong>Embeddings</strong> are dense vector representations of text that capture semantic meaning. Two texts about the same topic will have similar embeddings, even if they use completely different words.</p>\n        <h3>Available Models (2026)</h3>\n        <table><tr><th>Model</th><th>Dimensions</th><th>Max Tokens</th><th>Best For</th></tr>\n        <tr><td><strong>text-embedding-3-small</strong></td><td>1,536</td><td>8,191</td><td>Cost-effective, high-volume search</td></tr>\n        <tr><td><strong>text-embedding-3-large</strong></td><td>3,072</td><td>8,191</td><td>Maximum accuracy, complex similarity</td></tr></table>\n        <pre>const embedding = await openai.embeddings.create({\n  model: "text-embedding-3-small",\n  input: "How do I reset my password?",\n  dimensions: 1024  // Optional: reduce dimensions for efficiency\n});\n// Returns: { embedding: [0.0023, -0.0091, 0.0154, ...] }</pre>\n        <h3>Dimension Reduction</h3>\n        <p>
1Both models support <strong>native dimension reduction</strong>. You can request fewer dimensions (e.g., 256, 512, 1024) to save storage and improve search speed with minimal accuracy loss.</p>\n        <h3>Use Cases</h3>\n        <ul><li><strong>Semantic Search:</strong> Find documents by meaning, not keywords</li>\n        <li><strong>RAG:</strong> Retrieve relevant context for LLM prompts</li>\n        <li><strong>Clustering:</strong> Group similar content automatically</li>\n        <li><strong>Anomaly Detection:</strong> Find outliers in text datasets</li>\n        <li><strong>Recommendations:</strong> "Users who liked X also liked Y"</li></ul>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Pro Tip:</strong> Use <code>text-embedding-3-small</code> with 1,024 dimensions for 90% of use cases. Only upgrade to <code>large</code> when you need maximum precision for nuanced similarity tasks.</div>',quiz:[{q:"What is a text embedding?",options:["A compressed version of text","A dense vector representation that captures semantic meaning","An encrypted string","A database index"],correct:1,explanation:"Embeddings are numerical vectors where semantically similar texts are positioned close together in vector space."},{q:"How does native dimension reduction save costs?",options:["It makes the model smaller","Fewer dimensions = less storage + faster search with minimal accuracy loss","It compresses the API response","It reduces token count"],correct:1,explanation:"Requesting fewer dimensions (e.g., 256 instead of 3,072) reduces storage requirements and speeds up similarity searches."},{q:"Which embedding model should you use for most production workloads?",options:["text-embedding-3-large always","text-embedding-3-small - it covers 90% of use cases cost-effectively","text-embedding-ada-002 (legacy)","OpenAI o3-mini"],correct:1,explanation:"text-embedding-3-small provides excellent quality at a fraction of the cost of the large model, making it ideal for most applications."}]},{title:"Building RAG Pipelines",xp:250,duration:"15 min",lab:{title:"Generate Text Embeddings for Vector Search",xp:150,scenario:"Power semantic search and RAG retrieval. Generate 1,536-dimensional embeddings for a document chunk using text-embedding-3-small.",steps:[{say:"POST to /v1/embeddings targeting text-embedding-3-small.",check:["curl","v1/embeddings","text-embedding-3-small"],out:["{",'  "object": "list",','  "data": [','    { "object": "embedding", "index": 0, "embedding": [0.0182, -0.0241, 0.0093, 0.0381, ...] }',"  ],",'  "model": "text-embedding-3-small",','  "usage": { "prompt_tokens": 14, "total_tokens": 14 }',"}"],hint:'POST to https://api.openai.com/v1/embeddings with model "text-embedding-3-small" and input string.',cmd:'curl https://api.openai.com/v1/embeddings -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"text-embedding-3-small","input":"Vector search retrieves semantically similar documentation chunks."}\''}]},content:'<h2>Retrieval-Augmented Generation</h2>\n        <p><strong>RAG</strong> is the pattern of retrieving relevant documents from a knowledge base and injecting them into the LLM\'s context before generating a response. This eliminates hallucinations for domain-specific questions.</p>\n        <h3>The RAG Pipeline</h3>\n        <ol><li><strong>Ingest:</strong> Split documents into chunks → Embed each chunk → Store in vector database</li>\n        <li><strong>Query:</strong> Embed the user\'s question → Search vector DB for similar chunks</li>\n        <li><strong>Generate:</strong> Pass retrieved chunks + question to GPT → Get grounded answer</li></ol>\n        <h3>OpenAI Vector Stores</h3>\n        <p>OpenAI provides a fully managed vector store via the API. Upload files, and OpenAI handles chunking, embedding, and search automatically.</p>\n        <pre>// Create a vector store\nconst vs = await openai.vectorStores.create({ name: "product-docs" });\n\n// Upload files\nawait openai.vectorStores.files.create(vs.id, {\n  file_id: "file-abc123"  // Previously uploaded file\n});\n\n// Use in Responses API\nconst response = await openai.responses.create({\n  model: "o3-mini",\n  tools: [{ type: "file_search", vector_store_ids: [vs.id] }],\n  input: "What is our refund policy?"\n});</pre>\n        <div class="ca-callout"><strong>\uD83C\uDFAF When to Use:</strong> Use OpenAI Vector Stores for quick prototyping (up to 10,000 files). For massive-scale RAG with custom ranking, use Pinecone, Weaviate, or pgvector with the Embeddings API directly.</div>',quiz:[{q:"What problem does RAG solve?",options:["Slow API responses","LLM hallucinations - by grounding answers in retrieved documents","High token costs","Model training"],correct:1,explanation:"RAG injects real documents into the context, ensuring the model answers based on facts rather than generating plausible-sounding but incorrect information."},{q:"How many files can an OpenAI Vector Store hold?",options:["100","1,000","10,000","Unlimited"],correct:2,explanation:"OpenAI Vector Stores support up to 10,000 files, with automatic chunking, embedding, and search handled by the platform."},{q:"What are the three stages of a RAG pipeline?",options:["Train, Test, Deploy","Ingest (embed + store), Query (search), Generate (LLM + context)","Read, Write, Execute","Upload, Process, Download"],correct:1,explanation:"RAG follows three stages: Ingest (chunk and embed documents), Query (semantic search for relevant chunks), and Generate (feed chunks to the LLM)."}]}]},{name:"Fine-Tuning & Distillation",icon:"\uD83C\uDFAF",color:"#10a37f",level:"ADVANCED",desc:"Customize model behavior, tone, and format through fine-tuning. Distill large model knowledge into smaller, cheaper models.",lessons:[{title:"When & How to Fine-Tune",xp:300,duration:"15 min",lab:{title:"Launch a Fine-Tuning Job",xp:200,scenario:"Prompt engineering got you 90% there - the tone is still wrong. Run the full fine-tuning workflow: upload training data, create the job, poll until your custom model exists.",steps:[{say:"Upload your JSONL training file to the Files API with purpose fine-tune.",check:["curl","v1/files","purpose","fine-tune"],out:["{",'  "id": "file-abc123", "object": "file",','  "purpose": "fine-tune", "filename": "train.jsonl", "bytes": 210344',"}"],hint:'curl https://api.openai.com/v1/files -H "Authorization: Bearer $OPENAI_API_KEY" -F purpose=fine-tune -F [email protected]',cmd:'curl https://api.openai.com/v1/files -H "Authorization: Bearer $OPENAI_API_KEY" -F purpose=fine-tune -F [email protected]'},{say:"Create the fine-tuning job pointing at your uploaded file and a base model.",check:["curl","v1/fine_tuning/jobs","training_file"],out:["{",'  "id": "ftjob-abc123", "object": "fine_tuning.job",','  "model": "gpt-4o-mini", "status": "queued", "training_file": "file-abc123"',"}"],hint:'POST to /v1/fine_tuning/jobs with -d \'{"training_file":"file-abc123","model":"gpt-4o-mini"}\'',cmd:'curl https://api.openai.com/v1/fine_tuning/jobs -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"training_file":"file-abc123","model":"gpt-4o-mini"}\''},{say:"Poll the job until it succeeds and note the fine_tuned_model ID you'll use in production.",check:["curl","v1/fine_tuning/jobs/ftjob"],out:["{",'  "id": "ftjob-abc123", "status": "succeeded",','  "fine_tuned_model": "ft:gpt-4o-mini:acme-corp::BxK9zQ2m",','  "trained_tokens": 184320',"}"],hint:"GET https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123",cmd:'curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123 -H "Authorization: Bearer $OPENAI_API_KEY"'}]},content:'<h2>Customizing Model Behavior</h2>\n        <p><strong>Fine-tuning</strong> trains an existing OpenAI model on your own dataset to customize its behavior, tone, format, or domain knowledge. It does NOT add new knowledge - it adjusts HOW the model responds.</p>\n        <h3>Decision Framework</h3>\n        <table><tr><th>Try First</th><th>Then Try</th><th>Last Resort</th></tr>\n        <tr><td>Prompt Engineering</td><td>RAG (Retrieval)</td><td>Fine-Tuning</td></tr>\n        <tr><td>90% of use cases</td><td>Domain knowledge</td><td>Behavior/format changes</td></tr></table>\n        <h3>Fine-Tuning Workflow</h3>\n        <ol><li><strong>Prepare Data:</strong> Create a JSONL file of example conversations</li>\n        <li><strong>Upload:</strong> Upload the training file via the Files API</li>\n        <li><strong>Train:</strong> Create a fine-tuning job specifying the base model</li>\n        <li><strong>Evaluate:</strong> Test the fine-tuned model against your eval set</li>\n        <li><strong>Deploy:</strong> Use your custom model ID in API calls</li></ol>\n        <pre>// Training data format (JSONL):\n{"messages": [\n  {"role": "system", "content": "You are a concise legal assistant."},\n  {"role": "user", "content": "Summarize this contract clause..."},\n  {"role": "assistant", "content": "Key terms: ..."}\n]}\n\n// Create fine-tuning job:\nconst job = await openai.fineTuning.jobs.create({\n  training_file: "file-abc123",\n  model: "gpt-4o-mini",\n  hyperparameters: { n_epochs: 3 }\n});</pre>\n        <h3>Best Practices</h3>\n        <ul><li>Start with <strong>50-100 high-quality examples</strong> - quality over quantity</li>\n        <li>Always create a <strong>validation set</strong> (20% of data) to detect overfitting</li>\n        <li>Fine-tune the <strong>smallest model</strong> that meets your needs (Mini > Pro)</li>\n        <li>Use <strong>checkpoints</strong> to save intermediate states</li></ul>\n        <div class="ca-callout"><strong>\uD83C\uDFAF Rule:</strong> Fine-tuning is for changing behavior/format, NOT for adding knowledge. Use RAG for knowledge injection.</div>',quiz:[{q:"What should you try BEFORE fine-tuning?",options:["Nothing - always fine-tune first","Prompt engineering and RAG - they solve 90%+ of use cases without fine-tuning costs","Switching to a different provider","Rebuilding from scratch"],correct:1,explanation:"Fine-tuning is expensive and slow. Most use cases can be solved with better prompts or RAG. Only fine-tune when you need consistent behavioral changes."},{q:"What does fine-tuning actually change about a model?",options:["It adds new knowledge","It adjusts the model's behavior, tone, and output format based on your examples","It makes it faster","It reduces token costs"],correct:1,explanation:"Fine-tuning doesn't add factual knowledge - it teaches the model HOW to respond (format, style, tone) by learning from your examples."},{q:"What data format does OpenAI require for fine-tuning?",options:["CSV","JSONL with message arrays (system, user, assistant)","Plain text","XML"],correct:1,explanation:"Training data must be in JSONL format where each line contains a messages array with system, user, and assistant roles."}]},{title:"Model Distillation",xp:250,duration:"12 min",lab:{title:"Launch an Automated Distillation Job",xp:200,scenario:"Transfer intelligence from GPT-4o into a fast, cheap gpt-4o-mini student model using OpenAI's distillation API.",steps:[{say:"POST to /v1/fine_tuning/jobs specifying the training method distillation and the student model.",check:["curl","v1/fine_tuning/jobs","gpt-4o-mini","method|training_file"],out:["{",'  "id": "ftjob-01DistillJob",','  "object": "fine_tuning.job",','  "model": "gpt-4o-mini",','  "status": "validating_files",','  "method": { "type": "supervised" }',"}"],hint:'POST to https://api.openai.com/v1/fine_tuning/jobs with model "gpt-4o-mini" and training_file.',cmd:'curl https://api.openai.com/v1/fine_tuning/jobs -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o-mini","training_file":"file-distillDataset998","method":{"type":"supervised"}}\''}]},content:"<h2>Shrink the Cost, Keep the Quality</h2>\n        <p><strong>Model Distillation</strong> is the process of using a large, expensive model (teacher) to generate training data, then fine-tuning a smaller, cheaper model (student) to replicate the teacher's behavior.</p>\n        <h3>Distillation Pipeline</h3>\n        <ol><li><strong>Generate:</strong> Run flagship models (GPT-4o or o1) on 1,000 real-world queries. Save the outputs.</li>\n        <li><strong>Curate:</strong> Filter for high-quality responses. Remove errors.</li>\n        <li><strong>Fine-Tune:</strong> Train gpt-4o-mini on these curated examples.</li>\n        <li><strong>Evaluate:</strong> Compare gpt-4o-mini's outputs to GPT-4o on a held-out test set.</li></ol>\n        <h3>Cost Impact</h3>\n        <table><tr><th>Metric</th><th>Teacher (GPT-4o)</th><th>Distilled Student (gpt-4o-mini)</th><th>Savings</th></tr>\n        <tr><td>Cost per 1M tokens</td><td>~$10.00 (out) / $2.50 (in)</td><td>~$0.60 (out) / $0.15 (in)</td><td>94-97%</td></tr>\n        <tr><td>Latency</td><td>~1-3s</td><td>~0.2-0.4s</td><td>85-90%</td></tr>\n        <tr><td>Quality (on your task)</td><td>99%</td><td>94-96%</td><td>Minimal loss</td></tr></table>\n        <div class=\"ca-callout\"><strong>\uD83D\uDCA1 OpenAI Stored Completions:</strong> If you use <code>store: true</code> in the Responses API, OpenAI stores your completions. You can then use these stored outputs directly as fine-tuning data for distillation - no manual data collection needed.</div>",quiz:[{q:"What is model distillation?",options:["Compressing model weights","Using a large model's outputs to train a smaller model to replicate its behavior","Removing unused parameters","Convert
1ing to a different format"],correct:1,explanation:"Distillation uses the 'teacher' model's high-quality outputs as training data for a cheaper 'student' model, achieving similar quality at a fraction of the cost."},{q:"How does store: true help with distillation?",options:["It makes responses faster","It saves API responses that can be directly used as fine-tuning training data","It reduces costs immediately","It enables caching"],correct:1,explanation:"Stored completions capture real production outputs from your expensive model, which can then be used as training data to fine-tune a cheaper model."},{q:"What typical cost savings does distillation achieve?",options:["10-20%","50%","90-97% - by replacing expensive models with fine-tuned smaller ones","No savings"],correct:2,explanation:"Distilling from flagship models (GPT-4o or o1) to fine-tuned gpt-4o-mini can reduce costs by 90-97% while retaining 92-95% quality on your specific task."}]},{title:"Reinforcement Fine-Tuning & DPO",xp:350,duration:"18 min",lab:{title:"Configure Direct Preference Optimization (DPO)",xp:200,scenario:"Align model behavior using pairwise feedback datasets. Configure a fine-tuning job with DPO methodology.",steps:[{say:"Submit a fine-tuning job with method type set to dpo on a preference dataset.",check:["curl","v1/fine_tuning/jobs","dpo"],out:["{",'  "id": "ftjob-01DpoPreference",','  "object": "fine_tuning.job",','  "method": { "type": "dpo" },','  "status": "queued"',"}"],hint:'Add "method": {"type": "dpo"} to your fine-tuning job payload.',cmd:'curl https://api.openai.com/v1/fine_tuning/jobs -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o-mini","training_file":"file-dpoPairs123","method":{"type":"dpo"}}\''}]},content:'<h2>Beyond Supervised Fine-Tuning</h2>\n        <p><strong>Reinforcement Fine-Tuning (RFT)</strong> goes beyond traditional supervised fine-tuning by using <strong>verifiable rewards</strong> to train models on tasks where correctness can be programmatically checked - such as code execution, math proofs, or structured data extraction.</p>\n        <h3>How RFT Works</h3>\n        <ol><li><strong>Define a Grader:</strong> Write a programmable grader that scores model outputs (pass/fail, 0-1 score, or multi-criteria rubrics).</li>\n        <li><strong>Submit Training Prompts:</strong> Provide a set of prompts without reference answers - the model learns by generating candidates and receiving reward signals.</li>\n        <li><strong>Reinforcement Loop:</strong> The model iteratively improves, maximizing the grader\'s reward function. Unlike SFT, the model discovers its own optimal strategies.</li></ol>\n        <h3>Programmable Graders</h3>\n        <p>Graders are the core innovation. They can be simple (exact string match), moderate (unit test execution), or complex (LLM-as-judge with rubric). OpenAI provides built-in grader templates:</p>\n        <pre>// RFT training configuration\nconst job = await openai.fineTuning.jobs.create({\n  training_file: "file-prompts123",\n  model: "gpt-4o-mini",\n  method: {\n    type: "reinforcement",\n    reinforcement: {\n      grader: {\n        type: "code",  // Programmatic grader\n        source: "def grade(output, expected):\\n  return 1.0 if output.strip() == expected.strip() else 0.0"\n      }\n    }\n  }\n});</pre>\n        <h3>Direct Preference Optimization (DPO)</h3>\n        <p><strong>DPO</strong> is a complementary technique for <strong>preference alignment</strong> - teaching the model which of two outputs is preferred by humans. Instead of a scalar reward, you provide pairs of (chosen, rejected) responses. DPO adjusts the model to increase the likelihood of chosen outputs and decrease rejected ones, without needing a separate reward model.</p>\n        <h3>When to Use Each</h3>\n        <table><tr><th>Method</th><th>Best For</th><th>Data Required</th></tr>\n        <tr><td><strong>SFT (Supervised)</strong></td><td>Format, tone, style changes</td><td>Input → ideal output pairs</td></tr>\n        <tr><td><strong>RFT (Reinforcement)</strong></td><td>Verifiable tasks (code, math, extraction)</td><td>Prompts + programmable grader</td></tr>\n        <tr><td><strong>DPO (Preference)</strong></td><td>Subjective quality, safety alignment</td><td>Chosen/rejected response pairs</td></tr></table>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Key Insight:</strong> RFT excels when you can write a grader - code that passes tests, SQL that returns correct results, extractions that match sc
1hemas. DPO excels when quality is subjective and requires human judgment.</div>',quiz:[{q:"What makes RFT different from standard supervised fine-tuning?",options:["It uses more data","It uses verifiable rewards from programmable graders instead of reference answers","It's cheaper","It only works with OpenAI o1"],correct:1,explanation:"RFT trains through reinforcement - the model generates candidates and receives reward signals from graders, discovering optimal strategies rather than memorizing example outputs."},{q:"What is a programmable grader in RFT?",options:["A human reviewer","A function that programmatically scores model outputs (pass/fail, 0-1) to provide reward signals","A pre-trained classifier","An eval dashboard"],correct:1,explanation:"Programmable graders are code functions that evaluate model outputs - from simple string matching to executing unit tests - providing the reward signal for reinforcement learning."},{q:"When should you use DPO over RFT?",options:["For math problems","When quality is subjective and you have human preference pairs (chosen vs rejected responses)","When you need faster training","For code generation only"],correct:1,explanation:"DPO is ideal for subjective quality - when there's no programmatic way to verify correctness but humans can judge which response is better."}]}]},{name:"Speech & Audio APIs",icon:"\uD83C\uDF99️",color:"#10a37f",level:"INTERMEDIATE",desc:"Build voice applications with Whisper transcription, steerable TTS, and the Realtime voice API.",lessons:[{title:"Speech-to-Text (Transcription)",xp:200,duration:"12 min",lab:{title:"Transcribe Audio from the CLI",xp:150,scenario:"A 40-minute meeting recording just landed in your downloads. Transcribe it with the audio API using multipart form upload - no SDK required.",steps:[{say:"Export your OpenAI API key as OPENAI_API_KEY.",check:["export\\s+OPENAI_API_KEY=\\S"],out:["✓ OPENAI_API_KEY set for this session"],hint:"export OPENAI_API_KEY=sk-your-key",cmd:"export OPENAI_API_KEY=sk-proj-your-key-here"},{say:"POST meeting.mp3 to /v1/audio/transcriptions as multipart form data (-F) with model gpt-4o-mini-transcribe.",check:["curl","audio/transcriptions","-F","gpt-4o-mini-transcribe"],out:["{",'  "text": "Alright, let\'s review the Q3 roadmap. First item: the mobile release slips one sprint…"',"}"],hint:'curl https://api.openai.com/v1/audio/transcriptions -H "Authorization: Bearer $OPENAI_API_KEY" -F [email protected] -F model=gpt-4o-mini-transcribe - audio endpoints use -F (multipart), not -d (JSON).',cmd:'curl https://api.openai.com/v1/audio/transcriptions -H "Authorization: Bearer $OPENAI_API_KEY" -F [email protected] -F model=gpt-4o-mini-transcribe'},{say:"Re-run with response_format=verbose_json to get timestamps and detected language.",check:["curl","audio/transcriptions","verbose_json"],out:["{",'  "language": "english", "duration": 2412.4,','  "segments": [{ "start": 0.0, "end": 4.2, "text": "Alright, let\'s review the Q3 roadmap." }, …],','  "text": "Alright, let\'s review the Q3 roadmap…"',"}"],hint:"Add one more form field: -F response_format=verbose_json",cmd:'curl https://api.openai.com/v1/audio/transcriptions -H "Authorization: Bearer $OPENAI_API_KEY" -F [email protected] -F model=gpt-4o-mini-transcribe -F response_format=verbose_json'}]},content:'<h2>Audio Transcription Models</h2>\n        <p>OpenAI offers multiple transcription models for converting speech to text, from the legacy Whisper to the new GPT-powered models.</p>\n        <h3>Available Models (2026)</h3>\n        <table><tr><th>Model</th><th>Quality</th><th>Speed</th><th>Best For</th></tr>\n        <tr><td><strong>gpt-4o-mini-transcribe</strong></td><td>Highest accuracy</td><td>Fast</td><td>Production transcription (recommended)</td></tr>\n        <tr><td><strong>gpt-4o-transcribe</strong></td><td>Very high</td><td>Medium</td><td>Complex audio, heavy accents</td></tr>\n        <tr><td><strong>whisper-1</strong></td><td>Good</td><td>Fast</td><td>Legacy, basic transcription</td></tr></table>\n        <pre>const transcription = await openai.audio.transcriptions.create({\n  file: fs.createReadStream("meeting.mp3"),\n  model: "gpt-4o-mini-transcribe",\n  response_format: "verbose_json",  // Includes timestamps\n  language: "en"\n});\nconsole.log(transcription.text);</pre>\n        <h3>Key Features</h3>\n        <ul><li><strong>Timestamps:</strong> Get word-level or segment-level timing</li>\n        <li><strong>Language Detection:</strong> Automatic or manual language specification</li>\n        <li><strong>Translation:</strong> Translate non-English audio directly to English text</li></ul>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Pro Tip:</strong> Use <code>gpt-4o-mini-transcribe</code> for best results. It significantly outperforms legacy Whisper on noisy audio, accented speech, and alphanumeric content (phone numbers, codes).</div>',quiz:[{q:"Which transcription model is recommended for production in 2026?",options:["whisper-1","gpt-4o-mini-transcribe","gpt-4o-transcribe","speech-to-text-v2"],correct:1,explanation:"gpt-4o-mini-transcribe is the recommended model - it's fast, accurate, and handles noisy audio and accents better than legacy Whisper."},{q:"Can OpenAI transcription translate non-English audio to English?",options:["No, only English is supported","Yes - the translation endpoint converts foreign audio directly to English text","Only for European languages","Only with the Realtime API"],correct:1,explanation:"The translation endpoint accepts audio in any supp
1orted language and outputs English text directly."},{q:"What does response_format: 'verbose_json' add to transcriptions?",options:["Nothing extra","Word-level timestamps, language detection, and segment data","Speaker diarization","Audio quality metrics"],correct:1,explanation:"Verbose JSON includes detailed timing information, detected language, and segment boundaries alongside the transcription text."}]},{title:"Text-to-Speech & Realtime Voice",xp:250,duration:"15 min",lab:{title:"Synthesize Audio via the TTS API",xp:150,scenario:"Generate realistic natural speech from text. Call /v1/audio/speech with the tts-1 model and the nova voice.",steps:[{say:"POST to https://api.openai.com/v1/audio/speech specifying model tts-1, voice nova, and text input.",check:["curl","v1/audio/speech","tts-1","nova"],out:["HTTP/1.1 200 OK","Content-Type: audio/mpeg","Content-Length: 184320","[Binary audio data received: speech.mp3]"],hint:'Run: curl https://api.openai.com/v1/audio/speech -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"tts-1","input":"Welcome to OpenAI Academy.","voice":"nova"}\' --output speech.mp3',cmd:'curl https://api.openai.com/v1/audio/speech -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"tts-1","input":"Welcome to OpenAI Academy.","voice":"nova"}\' --output speech.mp3'}]},content:'<h2>Generating Speech</h2>\n        <p>The <strong>gpt-4o-mini-tts</strong> model generates natural-sounding speech with unprecedented control over tone, emotion, and delivery style.</p>\n        <pre>const audio = await openai.audio.speech.create({\n  model: "gpt-4o-mini-tts",\n  voice: "coral",\n  input: "Welcome to the Infinity Tech Stack Academy!",\n  instructions: "Speak with enthusiasm and energy, like a tech conference host.",\n  response_format: "mp3"\n});</pre>\n        <h3>Steerable TTS</h3>\n        <p>Unlike traditional TTS that just reads text flatly, <code>gpt-4o-mini-tts</code> accepts <strong>instructions</strong> that control HOW it speaks - tone, pacing, emotion, accent emphasis.</p>\n        <h3>Available Voices</h3>\n        <table><tr><th>Voice</th><th>Character</th></tr>\n        <tr><td><strong>alloy</strong></td><td>Neutral, balanced</td></tr>\n        <tr><td><strong>echo</strong></td><td>Warm, conversational</td></tr>\n        <tr><td><strong>fable</strong></td><td>Expressive, storytelling</td></tr>\n        <tr><td><strong>onyx</strong></td><td>Deep, authoritative</td></tr>\n        <tr><td><strong>nova</strong></td><td>Friendly, upbeat</td></tr>\n        <tr><td><strong>shimmer</strong></td><td>Soft, calm</td></tr>\n        <tr><td><strong>coral</strong></td><td>Clear, professional</td></tr></table>\n        <h2>The Realtime API (May 2026)</h2>\n        <p>For ultra-low latency voice applications, the <strong>Realtime API</strong> supports two transport protocols: <strong>WebSocket</strong> for server-to-server and Node.js clients, and <strong>WebRTC</strong> as the recommended transport for browser and mobile clients (lower latency, NAT traversal, built-in echo cancellation). New models launched in May 2026:</p>\n        <table><tr><th>Model</th><th>Capability</th></tr>\n        <tr><td><strong>gpt-realtime-2</strong></td><td>GPT-4o-class reasoning for live voice interactions</td></tr>\n        <tr><td><strong>gpt-realtime-translate</strong></td><td>Real-time multilingual speech translation</td></tr>\n        <tr><td><strong>gpt-realtime-whisper</strong></td><td>Live streaming speech-to-text transcription</td></tr></table>\n        <h3>Latest Realtime Models (per the official model catalog)</h3>\n        <table><tr><th>Model</th><th>Capability</th></tr>\n        <tr><td><strong>gpt-realtime-2.1</strong></td><td>Newest realtime reasoning model with tool use</td></tr>\n        <tr><td><strong>gpt-realtime-2.1-mini</strong></td><td>Cost-efficient version of gpt-realtime-2.1 with tool use</td></tr></table>\n        <p>The original <strong>gpt-realtime-mini</strong> is now listed as <strong>Deprecated</strong> in the official catalog - start new Realtime projects on gpt-realtime-2.1 or gpt-realtime-2.1-mini instead.</p>\n        <ul><li><strong>Voice Activity Detection (VAD):</strong> Automatically detects when users stop speaking</li>\n        <li><strong>Tool Calling in Voice:</strong> Trigger backend tools while speaking</li>\n        <li><strong>Audio Reasoning:</strong> Understands tone, inflection, and urgency</li></ul>\n        <div class="ca-callout"><strong>\uD83C\uDFAF Use Case Decision:</strong> Use TTS for pre-generated audio (podcasts, notifications). Use the Realtime API for interactive voice conversations (phone agents, assistants).</div>',quiz:[{q:"What makes gpt-4o-mini-tts different from traditional TTS?",options:["It's faster","It accepts natural language instructions to control tone, emotion, and delivery style","It only works in English","It generates video"],correct:1,explanation:"Steerable TTS lets you describe HOW you want it to speak (enthusiastic, calm, formal) - not just what to say."},{q:"What protocol does the Realtime API use?",options:["REST","WebSockets for persistent bidirectional audio streaming","GraphQL","gRPC"],correct:1,explanation:"WebSockets maintain a persistent connection, enabling real-time audio streaming without the overhead of repeated HTTP requests."},{q:"When should you use the Realtime API vs standard TTS?",options:["Always use Realtime","Realtime for interactive conversations; TTS for pre-generated audio content","Always use TTS","They're the same"],correct:1,explanation:"Realtime API is for live, interactive voice conversations. Standard TTS is for generating audio files (podcasts, notifications, voiceovers)."}]}]},{name:"Computer Use (CUA)",icon:"\uD83D\uDDA5️",color:"#10a37f",level:"ADVANCED",desc:"Build agents that interact with software through screenshots and mouse/keyboard actions using the Computer Use Agent.",lessons:[{title:"The Computer Use Agent",xp:300,duration:"15 min",lab:{title:"Issue Operator Computer Actions",xp:200,scenario:"Automate desktop web workflows with the Computer Use Agent. Submit an operator instruction with action parameters.",steps:[{say:"POST to /v1/responses with computer use tool enabled for browser interaction.",check:["curl","v1/responses","computer|operator"],out:["{",'  "id": "resp_01CuaOperator",','  "status": "completed",','  "output": [{ "type": "action", "action": "mouse_click", "coordinate": [450, 320] }, { "type": "text", "text": "Clicked checkout confirmation button." }]',"}"],hint:"POST to https://api.openai.com/v1/responses with computer tool configuration.",cmd:'curl https://api.openai.com/v1/responses -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o","input":"Navigate to store and click checkout","tools":[{"type":"computer"}]}\''}]},content:'<h2>AI That Operates Your Computer</h2>\n        <p>The <strong>Computer Use Agent (CUA)</strong> enables AI models to interact with any software through a screenshot-action loop: the model views a screenshot, decides what to click/type/scroll, and the action is executed in a virtual environment.</p>\n        <h3>How CUA Works</h3>\n        <ol><li><strong>Screenshot:</strong> Capture the current screen state</li>\n        <li><strong>Reasoning:</strong> The model analyzes the screenshot and decides the next action</li>\n        <li><strong>Action:</strong> Execute the action (click, type, scroll, drag)</li>\n        <li><strong>Repeat:</strong> Capture new screenshot, continue until task is complete</li></ol>\n        <h3>Supported Actions</h3>\n        <table><tr><th>Action</th><th>Description</th><th>Example</th></tr>\n        <tr><td><strong>click</strong></td><td>Click at coordinates (x, y)</td><td>Click "Submit" button</td></tr>\n        <tr><td><strong>type</strong></td><td>Type text into focused field</td><td>Enter email address</td></tr>\n        <tr><td><strong>scroll</strong></td><td>Scroll in a direction</td><td>Scroll down to see more results</td></tr>\n        <tr><td><strong>keypress</strong></td><td>Press keyboard shortcuts</td><td>Ctrl+S to save</td></tr>\n        <tr><td><strong>screenshot</strong></td><td>Capture current state</td><td>Observe changes after action</td></tr></table>\n        <pre>const response = await openai.responses.create({\n  model: "computer-use-preview",\n  tools: [{\n    type: "computer_use_preview",\n    display_width: 1024,\n    display_height: 768,\n    environment: "browser"\n  }],\n  input: "Go to Hacker News and find today\'s top story"\n});</pre>\n        <div class="ca-callout"><strong>⚠️ Safety Warning:</strong> Always run CUA in sandboxed environments (Docker, VMs, cloud sandboxes). Never give CUA access to your actual desktop - it could click on anything, including system settings or sensitive applications.</div>
1',quiz:[{q:"How does the Computer Use Agent interact with software?",options:["Through APIs","Via a screenshot-action loop: view screen → decide action → execute → repeat","By reading source code","Through keyboard macros only"],correct:1,explanation:"CUA views screenshots to understand the current state, then issues actions (click, type, scroll) to interact with any software visually."},{q:"Why must CUA always run in a sandboxed environment?",options:["For performance","Because it can click on anything - including sensitive system settings, personal data, or dangerous actions","It doesn't work outside sandboxes","For billing reasons"],correct:1,explanation:"CUA operates through visual interaction and can potentially click on any UI element. Sandboxing prevents it from accessing your real desktop, files, or accounts."},{q:"What is the key advantage of CUA over traditional API integrations?",options:["It's faster","It can interact with ANY software that has a UI - including legacy apps with no API","It's cheaper","It's more accurate"],correct:1,explanation:"CUA doesn't need an API - it works with any application that has a visual interface, making it perfect for legacy systems, web forms, and desktop apps."}]}]},{name:"Reasoning Models",icon:"\uD83E\uDDE0",color:"#10a37f",level:"MASTER",desc:"Master the o1, o3-mini, Sol 6.1, and Astra 6 frontier models - deep reasoning, adaptive effort, and zero-overhead autonomous tooling.",lessons:[{title:"Chain of Thought & Reasoning Architecture",xp:350,duration:"18 min",lab:{title:"Inspect o-Series Reasoning Token Allocations",xp:150,scenario:"OpenAI reasoning models generate hidden chain-of-thought tokens. Query o3-mini and inspect reasoning_tokens in usage.",steps:[{say:"POST a logic problem to /v1/chat/completions targeting o3-mini.",check:["curl","v1/chat/completions","o3-mini","messages"],out:["{",'  "id": "chatcmpl_01ReasoningTokens",','  "model": "o3-mini-2025-01-31",','  "choices": [{ "message": { "role": "assistant", "content": "The 50th prime number is 229." } }],','  "usage": {','    "prompt_tokens": 18,','    "completion_tokens": 192,','    "completion_tokens_details": { "reasoning_tokens": 128 }',"  }","}"],hint:'POST to https://api.openai.com/v1/chat/completions with model "o3-mini".',cmd:'curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"o3-mini","messages":[{"role":"user","content":"Calculate the 50th prime number with step proof."}]}\''}]},content:'<h2>A New Model in AI</h2>\n        <p>The reasoning model family (o1 → o3-mini → Sol 6.1 & Astra 6) represents a fundamental shift. Instead of generating answers token-by-token immediately, they use reinforcement learning to generate a hidden <strong>Chain of Thought (CoT)</strong> before producing the final output.</p>\n        <h3>The Evolution & Production Status</h3>\n        <table><tr><th>Model</th><th>Released</th><th>Key Advance</th><th>Production Status</th></tr>\n        <tr><td><strong>o1-preview</strong></td><td>Sep 2024</td><td>First reasoning preview without tools or structured outputs.</td><td><span style="color:#f59e0b">▲ SUPERSEDED</span></td></tr>\n        <tr><td><strong>o1 (o1-2024-12-17)</strong></td><td>Dec 2024</td><td>Full production reasoning, vision analysis, function calling, developer role.</td><td><span style="color:#10a37f">● ACTIVE (Deep Reasoning)</span></td></tr>\n        <tr><td><strong>o3-mini</strong></td><td>Jan 2025</td><td>Fast, cost-efficient reasoning with explicit effort calibration (low/medium/high).</td><td><span style="color:#10a37f">● ACTIVE (Fast Reasoning)</span></td></tr>\n        <tr><td><strong>GPT-6 Astra / Astra 6</strong></td><td>Sep 2026</td><td>
11.05M context, native zero-overhead multi-tool calling, deep proof synthesis, GPT-Live-1 audio.</td><td><span style="color:#10a37f">● ACTIVE (Flagship Omni)</span></td></tr>\n        <tr><td><strong>GPT-6.1 Sol / Sol 6.1</strong></td><td>Sep 2026</td><td>Advanced multi-agent reasoning, deep autonomous theorem proving, and unified Responses API integration.</td><td><span style="color:#10a37f">● ACTIVE (Flagship Reasoning)</span></td></tr></table>\n        <h3>How Reasoning Models Think</h3>\n        <ol><li>Break the problem into smaller steps.</li>\n        <li>Try different approaches.</li>\n        <li>Recognize mistakes and backtrack.</li>\n        <li>Synthesize a final, accurate answer.</li></ol>\n        <h3>Prompting Reasoning Models</h3>\n        <ul><li><strong>Keep it simple:</strong> State the problem directly. Do NOT say "think step by step."</li>\n        <li><strong>Provide edge cases:</strong> Give constraints the model should consider.</li>\n        <li><strong>Use the developer role:</strong> Reasoning models use <code>developer</code> instead of <code>system</code>.</li></ul>\n        <pre>// Reasoning models use the "developer" role:\nconst response = await openai.responses.create({\n  model: "o3-mini",\n  reasoning: { effort: "high" },  // low | medium | high\n  input: [\n    { role: "developer", content: "You are a math olympiad judge. Be rigorous." },\n    { role: "user", content: "Prove that sqrt(2) is irrational." }\n  ]\n});</pre>\n        <div class="ca-callout"><strong>⚠️ Anti-Pattern:</strong> Adding "think step by step" to a reasoning model prompt actually HURTS performance. The model already reasons internally - forcing a thinking pattern confuses its natural process.</div>',quiz:[{q:"How do reasoning models differ from GPT-4o?",options:["They are faster","They generate a hidden Chain of Thought before answering, making them more accurate for complex logic","They only generate images","They are cheaper"],correct:1,explanation:"Reasoning models spend compute time 'thinking' internally before producing output, making them dramatically more accurate for math, coding, and multi-step logic."},{q:"Why should you avoid 'think step by step' in o1/o3 prompts?",options:["It crashes the API","The model already reasons internally - forcing a pattern degrades its natural reasoning process","It costs more tokens","It only works with GPT-4o"],correct:1,explanation:"Reasoning models are trained to figure out the best thinking approach autonomously. External CoT instructions conflict with their internal process."},{q:"What message role replaces 'system' for reasoning models?",options:["admin","developer","root","instructor"],correct:1,explanation:"Reasoning models use the 'developer' message role instead of 'system' for providing context and instructions."}]},{title:"Reasoning Effort & Adaptive Thinking",xp:300,duration:"12 min",lab:{title:"Calibrate Reasoning Effort Levels",xp:200,scenario:"Control reasoning budget and inference latency on o3-mini. Submit a request with reasoning_effort set to high.",steps:[{say:"POST to /v1/chat/completions with reasoning_effort set to high on o3-mini.",check:["curl","v1/chat/completions","o3-mini","reasoning_effort.*high"],out:["{",'  "id": "chatcmpl_01HighEffort",','  "choices": [{ "message": { "role": "assistant", "content": "After exhaustively checking constraint boundaries, the optimal configuration is proven." } }],','  "usage": { "completion_tokens_details": { "reasoning_tokens": 1408 } }',"}"],hint:'Add "reasoning_effort": "high" to the request body.',cmd:'curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"o3-mini","reasoning_effort":"high","messages":[{"role":"user","content":"Solve complex constraint optimization puzzle."}]}\''}]},content:'<h2>Calibrating Reasoning Depth</h2>\n        <p>The <strong>reasoning effort</strong> parameter lets you control how much time the model spends thinking. This is a cost-quality tradeoff.</p>\n        <h3>Effort Levels</h3>\n        <table><tr><th>Level</th><th>Thinking Time</th><th>Cost</th><th>Best For</th></tr>\n        <tr><td><strong>low</strong></td><td>~1-2s</td><td>Lowest</td><td>Simple classification, quick answers</td></tr>\n        <tr><td><strong>medium</strong></td><td>~3-5s</td><td>Moderate</td><td>Standard coding, analysis</td></tr>\n        <tr><td><strong>high</strong></td><td>~5-30s</td><td>Highest</td><td>Complex math, architecture design, research</td></tr></table>\n        <h3>OpenAI o3-mini Adaptive Reasoning</h3>\n        <p>OpenAI o3-mini models feature <strong>adaptive reasoning</strong> - they automatically decide whether to think deeply or respond instantly based on query complexity. You can override this with explicit effort settings.</p>\n        <pre>// Let the model decide how much to think:\nconst simple = await openai.responses.create({\n  model: "o3-mini",\n  input: "What is 2+2?"  // Instant response, no deep thinking\n});\n\n// Force deep reasoning:\nconst complex = await openai.responses.create({\n  model: "o3-mini",\n  reasoning: { effort: "high" },\n  input: "Design a distributed consensus algorithm for a 10-node cluster"\n});</pre>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Cost Tip:</strong> Let OpenAI o3-mini use adaptive reasoning by default. Only set explicit effort levels when you know the task complexity upfront.</div>',quiz:[{q:"What does the reasoning effort parameter control?",options:["Model temperature","How much time and compute the model spends thinking before answering","The number of tokens generated","Network latency"],correct:1,explanation:"Reasoning effort controls the depth of the model's internal Chain of Thought - higher effort means more thinking time but better accuracy on complex tasks."},{q:"What is adaptive reasoning in OpenAI o3-mini?",options:["The model auto-scales server resources","The model automatically decides whether to think deeply or respond instantly based on query complexity","It adapts to different languages","It learns from your data"],correct:1,explanation:"Adaptive reasoning lets OpenAI o3-mini dynamically allocate thinking time - simple questions get instant answers, complex ones trigger deep reasoning."},{q:"When should you set reasoning effort to 'high'?",options:["Always","For complex math, architecture design, and research tasks that need deep multi-step reasoning","Never - adaptive is always better","Only for image generation"],correct:1,explanation:"High effort is for genuinely complex tasks where accuracy is critical and latency is acceptable - math proofs, system design, research synthesis."}]}]},{name:"Image & Multimodal",icon:"\uD83D\uDDBC️",color:"#10a37f",level:"ADVANCED",desc:"Generate and edit images with GPT Image 2, process visual inputs, and build multimodal applications.",lessons:[{title:"GPT Image 2 & Image Thinking",xp:300,duration:"15 min",lab:{title:"Generate High-Definition Visuals with DALL-E",xp:150,scenario:"Synthesize visual assets using OpenAI's image generation endpoint. Request a 1024x1024 high-definition image via /v1/images/generations.",steps:[{say:"POST to https://api.openai.com/v1/images/generations with model dall-e-3 and size 1024x1024.",check:["curl","v1/images/generations","dall-e-3","1024x1024"],out:["{",'  "created": 1727884800,','  "data": [','    { "revised_prompt": "A clean futuristic data center...", "url": "https://oaidalleapiprodscus.blob.core.windows.net/..." }',"  ]","}"],hint:'Specify model "dall-e-3", prompt, and size "1024x1024".',cmd:'curl https://api.openai.com/v1/images/generations -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"dall-e-3","prompt":"Futuristic server room neon cyber aesthetics","size":"1024x1024"}\''}]},content:'<h2>Next-Gen Visual Generation (April 2026)</h2>\n        <p><strong>GPT Image 2</strong> replaces DALL-E 3 as OpenAI\'s premier visual generation model. It introduces token-based pricing, flexible aspect ratios, and extreme high-fidelity text rendering.</p>\n        <h3>Key Capabilities</h3>\n        <table><tr><th>Feature</th><th>DALL-E 3</th><th>GPT Image 2</th></tr>\n        <tr><td>Text in images</td><td>Often garbled</td><td>Pixel-perfect rendering</td></tr>\n        <tr><td>Aspect ratios</td><td>Fixed (1:1, 16:9)</td><td>Fully flexible</td></tr>\n        <tr><td>Editing</td><td>Inpainting only</td><td>Full conversational editing</td></tr>\n        <tr><td>Pricing</td><td>Per-image</td><td>Token-based (pay for complexity)</td></tr></table>\n        <pre>const image = await openai.images.generate({\n  model: "gpt-image-2",\n  prompt: "A futuristic Tokyo skyline at sunset, cyberpunk style, 8K detail",\n  size: "1536x1024",\n  quality: "high"\n});</pre>\n        <h3>GPT Image Thinking</h3>\n        <p>A specialized variant that combines <strong>reasoning with visual generation</strong>. It can analyze complex prompts, perform web searches for visual reference, and autonomously refine outputs before returning the final image.</p>\n        <h3>Vision Input (Multimodal)</h3>\n        <p>All OpenAI o3-mini models accept <strong>image inputs</strong> - upload photos, screenshots, charts, or documents and the model will analyze them.</p>\n        <pre>const response = await openai.responses.create({\n  model: "o3-mini",\n  input: [{\n    role: "user",\n    content: [\n      { type: "input_text", text: "What\'s in this screenshot?" },\n      { type: "input_image", image_url: "https://example.com/screenshot.png" }\n    ]\n  }]\n});</pre>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Tip:</strong> GPT Image Thinking is ideal for design iteration - describe changes in natural language and it refines the image conversationally.</div>',quiz:[{q:"What distinguishes GPT Image Thinking from standard image generation?",options:["It's free","It combines reasoning and web search to autonomously refine visual outputs","It only generates 3D models","It generates videos"],correct:1,explanation:"GPT Image Thinking uses an iterative reasoning loop to analyze prompts deeply, search for visual references, and refine outputs autonomously."},{q:"How is GPT Image 2 priced compared to DALL-E 3?",options:["Same per-image pricing","Token-based pricing - you pay for prompt complexity, not a flat per-image rate","Free for all users","Subscription only"],correct:1,explanation:"GPT Image 2 uses token-based pricing, meaning simpler prompts cost less and complex ones cost more - a more flexible model than flat per-image rates."},{q:"Can OpenAI o3-mini models analyze uploaded images?",options:["No, they only process text","Yes - all OpenAI o3-mini models accept image inputs for visual analysis","Only OpenAI o3-mini Thinking","Only with a separate API"],correct:1,explanation:"All OpenAI o3-mini models are natively multimodal - they can analyze photos, screenshots, charts, documents, and any visual content."}]}]},{name:"Production & Cost Optimization",icon:"\uD83D\uDCB0",color:"#10a37f",level:"MASTER",desc:"Optimize costs with the Batch API, prompt c
1aching, evals, rate limits, and the Moderation API.",lessons:[{title:"The Batch API",xp:250,duration:"12 min",lab:{title:"Submit Your First Batch Job",xp:200,scenario:"10,000 classification requests, none urgent. Upload a .jsonl input file, then create a batch - 50% cheaper than synchronous calls with a 24h completion window.",steps:[{say:"Upload your batchinput.jsonl via the Files API with curl, setting purpose to 'batch'.",check:["curl","api\\.openai\\.com/v1/files","purpose","batch"],out:["{",'  "id": "file-abc123",','  "object": "file", "purpose": "batch",','  "filename": "batchinput.jsonl"',"}"],hint:'curl https://api.openai.com/v1/files -H "Authorization: Bearer $OPENAI_API_KEY" -F purpose="batch" -F file="@batchinput.jsonl"',cmd:'curl https://api.openai.com/v1/files -H "Authorization: Bearer $OPENAI_API_KEY" -F purpose="batch" -F file="@batchinput.jsonl"'},{say:"Create the batch: POST to /v1/batches referencing the file ID, endpoint and the 24h completion window.",check:["curl","api\\.openai\\.com/v1/batches","input_file_id","completion_window"],out:["{",'  "id": "batch_abc123", "object": "batch",','  "endpoint": "/v1/chat/completions",','  "status": "validating", "completion_window": "24h"',"}","✓ job queued - poll /v1/batches/batch_abc123 for status, results land in output_file_id"],hint:'curl https://api.openai.com/v1/batches -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"input_file_id":"file-abc123","endpoint":"/v1/chat/completions","completion_window":"24h"}\'',cmd:'curl https://api.openai.com/v1/batches -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"input_file_id":"file-abc123","endpoint":"/v1/chat/completions","completion_window":"24h"}\''}]},content:'<h2>50% Cost Savings for Async Work</h2>\n        <p>The <strong>Batch API</strong> lets you submit large batches of requests asynchronously. In exchange for flexible completion times (up to 24 hours), you get a 50% discount on input/output tokens.</p>\n        <h3>When to Use Batch API</h3>\n        <table><tr><th>✅ Good Fit</th><th>❌ Bad Fit</th></tr>\n        <tr><td>Bulk classification (10K+ items)</td><td>Real-time chat responses</td></tr>\n        <tr><td>Dataset labeling/annotation</td><td>User-facing interactions</td></tr>\n        <tr><td>Content moderation queues</td><td>Time-sensitive queries</td></tr>\n        <tr><td>Embedding generation at scale</td><td>Interactive agents</td></tr></table>\n        <pre>// 1. Create a JSONL file of requests\n// 2. Upload it\nconst file = await openai.files.create({\n  file: fs.createReadStream("batch_requests.jsonl"),\n  purpose: "batch"\n});\n\n// 3. Submit the batch\nconst batch = await openai.batches.create({\n  input_file_id: file.id,\n  endpoint: "/v1/responses",\n  completion_window: "24h"\n});\n\n// 4. Poll for completion\nconst status = await openai.batches.retrieve(batch.id);\n// status.status: "completed" → download results</pre>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Pro Tip:</strong> Batch API works with all endpoints - Responses, Chat Completions, Embeddings, and even Image Generation. Use it for any high-volume, non-urgent workload.</div>',quiz:[{q:"How much discount does the Batch API provide?",options:["10%","25%","50% on input/output tokens","75%"],correct:2,explanation:"The Batch API provides a 50% discount in exchange for flexible completion times (up to 24 hours)."},{q:"What is the maximum completion window for a Batch API request?",options:["1 hour","6 hours","24 hours","7 days"],correct:2,explanation:"Batches must complete within 24 hours, though most finish much faster depending on size and server load."},{q:"Which workloads are NOT suitable for the Batch API?",options:["Bulk classification","Real-time user-facing chat - because batch responses are asynchronous","Dataset labeling","Embedding generation"],correct:1,explanation:"The Batch API is asynchronous - responses can take hours. It's unsuitable for real-time interactions where users expect instant replies."}]},{title:"Prompt Caching & Cost Control",xp:250,duration:"12 min",lab:{title:"Measure Automatic Prompt Caching Savings",xp:150,scenario:"OpenAI automatically caches prefixes of 1,024+ tokens at a 50% discount. Inspect prompt_tokens_details.cached_tokens.",steps:[{say:"POST a large context prompt to /v1/chat/completions and verify prompt token caching in the response usage.",check:["curl","v1/chat/completions","gpt-4o","messages"],out:["{",'  "id": "chatcmpl_01CacheMetrics",','  "usage": {','    "prompt_tokens": 2048,','    "prompt_tokens_details": { "cached_tokens": 1024 },','    "completion_tokens": 45',"  }","}
1"],hint:"Send POST to https://api.openai.com/v1/chat/completions with a reusable prompt body.",cmd:'curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o","messages":[{"role":"system","content":"Long corporate guideline context... (1024+ tokens)"},{"role":"user","content":"Summarize compliance section."}]}\''}]},content:'<h2>Automatic Prompt Caching</h2>\n        <p>The Responses API automatically caches repeated prompt prefixes. If your requests share a long system prompt or common context, subsequent requests pay <strong>reduced input token costs</strong> for the cached portion.</p>\n        <h3>How It Works</h3>\n        <ul><li>The API detects when multiple requests share identical prefix content</li>\n        <li>Cached tokens are billed at a discounted rate (up to 90% off)</li>\n        <li>No configuration needed - it\'s automatic with the Responses API</li>\n        <li>Cache typically persists for 5-10 minutes between requests</li></ul>\n        <h3>Maximizing Cache Hits</h3>\n        <ol><li>Put <strong>static content first</strong> - system prompts, instructions, examples</li>\n        <li>Put <strong>dynamic content last</strong> - user queries, variable data</li>\n        <li>Keep system prompts <strong>identical</strong> across requests</li></ol>\n        <h3>Rate Limits & Tiers</h3>\n        <table><tr><th>Tier</th><th>RPM</th><th>TPM</th><th>How to Upgrade</th></tr>\n        <tr><td><strong>Free</strong></td><td>3</td><td>40K</td><td>-</td></tr>\n        <tr><td><strong>Tier 1</strong></td><td>500</td><td>200K</td><td>$5 paid</td></tr>\n        <tr><td><strong>Tier 2</strong></td><td>5,000</td><td>2M</td><td>$50+ paid, 7+ days</td></tr>\n        <tr><td><strong>Tier 3</strong></td><td>5,000</td><td>10M</td><td>$100+ paid, 7+ days</td></tr>\n        <tr><td><strong>Tier 4+</strong></td><td>10,000</td><td>50M+</td><td>$250+ paid, 14+ days</td></tr></table>\n        <div class="ca-callout"><strong>\uD83C\uDFAF Cost Formula:</strong> Total cost = (Uncached input tokens * rate) + (Cached tokens * 0.1 * rate) + (Output tokens * rate). With up to 90% off cached input tokens, structuring prompts for maximum cache hits is critical.</div>',quiz:[{q:"How do you enable prompt caching in the Responses API?",options:["Set cache: true","It's automatic - no configuration needed","Use a special header","Pay for a premium plan"],correct:1,explanation:"Prompt caching is automatic in the Responses API. The system detects shared prefixes and caches them transparently."},{q:"How should you structure prompts to maximize cache hits?",options:["Put dynamic content first","Put static content (system prompt, examples) first and dynamic content (user query) last","Randomize the order","Keep prompts short"],correct:1,explanation:"Caching works on shared prefixes. Placing static content first ensures the maximum portion of each request hits the cache."},{q:"What typical discount do cached tokens receive?",options:["10%","25%","50%","Up to 90% off the standard input token rate"],correct:3,explanation:"Cached input tokens receive up to 90% off the standard rate, matching industry-leading cache discounts and providing massive savings for repetitive prompts."}]},{title:"Evals & Moderation",xp:250,duration:"12 min",lab:{title:"Screen Content with the Moderation API",xp:150,scenario:"Before user text reaches your agent, it must pass through a safety gate. Wire up the free Moderation endpoint and inspect its category scores.",steps:[{say:"POST user text to /v1/moderations using the omni-moderation-latest model.",check:["curl","v1/moderations","omni-moderation-latest"],out:["{",'  "results": [{ "flagged": false,','    "categories": { "harassment": false, "violence": false, "self-harm": false, … } }]',"}"],hint:'curl https://api.openai.com/v1/moderations … -d \'{"model":"omni-moderation-latest","input":"I will destroy you at chess on Friday"}\'',cmd:'curl https://api.openai.com/v1/moderations -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"omni-moderation-latest","input":"I will destroy you at chess on Frid
1ay"}\''},{say:"Pipe the response through jq to inspect the numeric category_scores - your thresholds live here.",check:["\\|\\s*jq","category_scores"],out:["{",'  "violence": 0.0021,','  "harassment": 0.0084,','  "self-harm": 0.0001',"}","✓ Context understood - chess trash-talk is not violence. Set your own thresholds per category."],hint:"Append: | jq '.results[0].category_scores'",cmd:'curl -s https://api.openai.com/v1/moderations -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"omni-moderation-latest","input":"I will destroy you at chess on Friday"}\' | jq \'.results[0].category_scores\''}]},content:'<h2>Evaluating AI Quality</h2>\n        <p><strong>Evals</strong> are automated tests that measure your AI system\'s quality. OpenAI provides an evaluation framework for testing model outputs against expected results.</p>\n        <h3>Types of Evals</h3>\n        <table><tr><th>Eval Type</th><th>Method</th><th>Best For</th></tr>\n        <tr><td><strong>Exact Match</strong></td><td>Output must match expected value exactly</td><td>Classification, structured data</td></tr>\n        <tr><td><strong>LLM-as-Judge</strong></td><td>A separate model scores the output quality</td><td>Creative writing, summaries</td></tr>\n        <tr><td><strong>Semantic Similarity</strong></td><td>Embedding distance between output and expected</td><td>Open-ended questions</td></tr>\n        <tr><td><strong>Human Review</strong></td><td>Manual scoring by domain experts</td><td>Complex, subjective tasks</td></tr></table>\n        <h2>The Moderation API</h2>\n        <p>The <strong>Moderation API</strong> is a free endpoint that classifies text into safety categories (hate, violence, self-harm, sexual content). Use it as a pre-filter before processing user input.</p>\n        <pre>const moderation = await openai.moderations.create({\n  input: userMessage\n});\nif (moderation.results[0].flagged) {\n  return "This content violates our usage policy.";\n}</pre>\n        <div class="ca-callout"><strong>\uD83D\uDD12 Production Rule:</strong> Always run user inputs through the Moderation API before passing them to your main model. It\'s free and prevents harmful content from entering your pipeline.</div>',quiz:[{q:"What is an 'LLM-as-Judge' eval?",options:["A legal AI tool","Using a separate model to score the quality of another model's output","A benchmarking competition","A moderation filter"],correct:1,explanation:"LLM-as-Judge uses a second model (often a stronger one) to evaluate and score the quality of your primary model's outputs."},{q:"How much does the Moderation API cost?",options:["$0.01 per request","Same as gpt-4o-mini","It's free","$0.001 per token"],correct:2,explanation:"The Moderation API is completely free and should be used as a safety pre-filter in every production application."},{q:"When should you run the Moderation API?",options:["Only in development","Before processing ANY user input - as a pre-filter before your main model","Only for Enterprise customers","After generating outputs"],correct:1,explanation:"The Moderation API should be the first step in your pipeline - filtering harmful content before it reaches your main model."}]}]},{name:"Assistants API (Legacy)",icon:"\uD83D\uDCE6",color:"#10a37f",level:"INTERMEDIATE",desc:"Understand the legacy Assistants API - stateful threads, runs, and tools. Migrate to the Responses API for new projects.",lessons:[{title:"Threads, Runs & Tools",xp:250,duration:"18 min",lab:{title:"Verify Assistants API Sunset Migration",xp:150,scenario:"The Assistants API is deprecated in favor of Responses API. Query the migration bridge to verify thread status.",steps:[{say:"Send a GET request to /v1/assistants to audit legacy assistant entities before migrating to Responses API.",check:["curl","api\\.openai\\.com/v1/assistants","Authorization"],out:["{",'  "object": "list",','  "data": [','    { "id": "asst_01LegacySupport", "name": "SupportBot", "model": "gpt-4o" }',"  ]","}"],hint:'Run: curl https://api.openai.com/v1/assistants -H "Authorization: Bearer $OPENAI_API_KEY" -H "OpenAI-Beta: assistants=v2"',cmd:'curl https://api.openai.com/v1/assistants -H "Authorization: Bearer $OPENAI_API_KEY" -H "OpenAI-Beta: assistants=v2"'}]},content:'<h2>The Legacy Stateful API (Sunset Completed)</h2>\n        <p>The <strong>Assistants API</strong>
1 was OpenAI\'s first attempt at stateful AI infrastructure. As of <strong>August 26, 2026</strong>, the Assistants API was <strong>officially retired and shut down</strong>. Calls to <code>/v1/assistants</code>, <code>/v1/threads</code>, and <code>/v1/runs</code> now return 410 Gone. All developers must migrate to the <strong>Responses API</strong>, the <strong>Conversations API</strong>, or the <strong>Agents API</strong> (launched September 10, 2026).</p>\n        <h3>Core Concepts (Historical Reference)</h3>\n        <ul><li><strong>Assistant:</strong> An AI entity with custom instructions, a model choice, and enabled tools. (Replaced by <code>Agent</code> in the Agents API / SDK).</li>\n        <li><strong>Thread:</strong> A persistent conversation session. (Replaced by <code>conversation_id</code> in the Conversations API and managed sessions in Agents API).</li>\n        <li><strong>Message:</strong> Text or files added to a Thread by a user or Assistant.</li>\n        <li><strong>Run:</strong> The asynchronous execution of an Assistant on a Thread. (Replaced by synchronous streaming in Responses API and background executions in Agents API).</li></ul>\n        <h3>Migration Matrix (August 2026+)</h3>\n        <table><tr><th>Legacy Assistants Feature</th><th>Modern Replacement</th><th>Migration Path</th></tr>\n        <tr><td><strong>File Search (Vector Store)</strong></td><td>Responses API <code>file_search</code> tool</td><td>Attach vector store ID directly to <code>/v1/responses</code> payload</td></tr>\n        <tr><td><strong>Code Interpreter</strong></td><td>Agents API Sandboxed Python or Responses API <code>code_interpreter</code></td><td>Zero client maintenance with native container execution</td></tr>\n        <tr><td><strong>Custom Functions</strong></td><td>Agents SDK <code>@function_tool</code> or Responses API <code>tools</code></td><td>Strictly typed Pydantic or JSON schema execution</td></tr>\n        <tr><td><strong>Persistent Threads</strong></td><td>Conversations API / Agents API Sessions</td><td>Store session state automatically on managed cloud harness</td></tr></table>\n        <div class="ca-callout"><strong>\uD83D\uDEA8 SUNSET COMPLETE (August 26, 2026):</strong> The Assistants API is permanently offline. Production applications must route traffic to the <strong>Responses API</strong> for low-latency completions or the <strong>OpenAI Agents API</strong> for stateful, sandboxed agent operations. Azure OpenAI workloads must migrate to <strong>Microsoft Foundry Agent Service</strong>.</div>',quiz:[{q:"What is the official operational status of the OpenAI Assistants API as of August 26, 2026?",options:["Active and recommended for new projects","Fully sunset and retired - endpoints return 410 Gone and developers must use Responses API or Agents API","Only available on free accounts","Renamed to Chat Completions"],correct:1,explanation:"OpenAI officially sunset the Assistants API on August 26, 2026, superseding it with the Responses API and the Agents API."},{q:"What is the modern replacement for Assistants API persistent Threads and Runs?",options:["A local text file","The Conversations API and the managed sessions in the OpenAI Agents API","Raw base64 strings","There is no replacement"],correct:1,explanation:"The Conversations API and Agents API provide modern, fully supported session persistence and asynchronous execution harnesses."},{q:"Why should new projects use the Responses API instead of legacy endpoints?",options:["The Responses API has all Assistants features plus web search, CUA, MCP, automatic prompt caching, and better performance","It costs 10x more","It only supports text","It has no tool support"],correct:0,explanation:"The Responses API is a complete superset featuring native prompt c
1aching, web search, computer use, and low latency."}]}]},{name:"Enterprise Privacy & Governance",icon:"\uD83D\uDEE1️",color:"#10a37f",level:"MASTER",desc:"Implement enterprise security with the Privacy Filter, data retention policies, and SOC2/GDPR compliance.",lessons:[{title:"The Privacy Filter Model",xp:350,duration:"15 min",lab:{title:"Audit Enterprise Zero Data Retention (ZDR)",xp:150,scenario:"Enterprise agreements support Zero Data Retention. Include organizational headers and verify data privacy compliance.",steps:[{say:"POST to /v1/chat/completions including the OpenAI-Organization header.",check:["curl","v1/chat/completions","OpenAI-Organization"],out:["HTTP/1.1 200 OK","openai-model: gpt-4o-mini","openai-organization: org-enterprise-security",'{ "choices": [{ "message": { "role": "assistant", "content": "Enterprise request verified under ZDR compliance." } }] }'],hint:'Add -H "OpenAI-Organization: org-enterprise-security".',cmd:'curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "OpenAI-Organization: org-enterprise-security" -H "Content-Type: application/json" -d \'{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Ping enterprise endpoint"}]}\''}]},content:'<h2>Local PII Redaction (April 2026)</h2>\n        <p>OpenAI released the <strong>Privacy Filter</strong>, an open-weight 1.5B parameter model designed to detect and redact Personally Identifiable Information (PII) before data leaves your infrastructure.</p>\n        <h3>Enterprise Architecture</h3>\n        <ol><li>User submits raw text containing sensitive data.</li>\n        <li>Local Privacy Filter scans and replaces PII with tokens (e.g., <code>[NAME_1]</code>, <code>[CREDIT_CARD]</code>).</li>\n        <li>Sanitized text is sent to the OpenAI API for processing.</li>\n        <li>API returns results. Local system maps tokens back to original PII.</li></ol>\n        <h3>Data Retention Policies</h3>\n        <table><tr><th>Plan</th><th>Data Used for Training?</th><th>Retention</th></tr>\n        <tr><td><strong>API (default)</strong></td><td>No</td><td>30 days for abuse monitoring</td></tr>\n        <tr><td><strong>API (zero retention)</strong></td><td>No</td><td>0 days - nothing stored</td></tr>\n        <tr><td><strong>ChatGPT Free</strong></td><td>Yes (opt-out available)</td><td>Varies</td></tr>\n        <tr><td><strong>ChatGPT Enterprise</strong></td><td>No</td><td>Configurable</td></tr></table>\n        <h3>Compliance Certifications</h3>\n        <ul><li><strong>SOC 2 Type II:</strong> Enterprise security controls verified</li>\n        <li><strong>GDPR:</strong> EU data processing agreements available</li>\n        <li><strong>HIPAA:</strong> BAA available for healthcare customers</li></ul>\n        <div class="ca-callout"><strong>\uD83D\uDD12 Zero-Trust Pattern:</strong> Privacy Filter + Zero Retention API = sensitive data never touches OpenAI\'s servers in readable form. This satisfies the strictest compliance requirements.</div>',quiz:[{q:"Where is the Privacy Filter model deployed?",options:["On OpenAI's servers","Locally on the enterprise's own infrastructure","In the browser","On a blockchain"],correct:1,explanation:"As an open-weight model, it's deployed locally s
1o sensitive data is redacted before touching any external network."},{q:"Does the OpenAI API use your data for training?",options:["Yes, always","No - API data is NOT used for training by default","Only for free tier","Only with consent"],correct:1,explanation:"API data is not used for model training. It's retained for up to 30 days for abuse monitoring only, with zero-retention options available."},{q:"What compliance certifications does OpenAI offer?",options:["None","SOC 2 Type II, GDPR (DPA), and HIPAA (BAA)","Only SOC 2","Only GDPR"],correct:1,explanation:"OpenAI provides SOC 2 Type II certification, GDPR Data Processing Agreements, and HIPAA Business Associate Agreements for enterprise customers."}]}]},{name:"OpenAI Frontier Architecture",icon:"\uD83E\uDDE0",color:"#10a37f",level:"EXPERT",desc:"Master the architecture of OpenAI reasoning models (o1, o3-mini), reasoning effort controls, and modern API standards.",lessons:[{title:"Reasoning Models Architecture & Controls",xp:400,duration:"15 min",lab:{title:"Deploy Developer Messages on o1 Models",xp:200,scenario:"o1 and o3 models replace the system role with developer messages for strict behavioral guidance. Submit an o1 developer message.",steps:[{say:"POST to /v1/chat/completions targeting o1 using the developer role instead of system.",check:["curl","v1/chat/completions","o1","developer"],out:["{",'  "id": "chatcmpl_01DeveloperRole",','  "choices": [{ "message": { "role": "assistant", "content": "Mathematical invariant verified." } }]',"}"],hint:'Specify role: "developer" in messages array.',cmd:'curl https://api.openai.com/v1/chat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"o1","messages":[{"role":"developer","content":"Strict constraint: return only mathematical proofs without prose."},{"role":"user","content":"Prove sqrt(2) is irrational."}]}\''}]},content:'<h2>OpenAI Reasoning Models: o1 & o3-mini</h2>\n        <p>OpenAI\'s reasoning models (<strong>o1</strong> and <strong>o3-mini</strong>) are trained with reinforcement learning to generate internal chains of thought before producing a response. This allows them to excel in STEM, complex coding, and multi-step analytical reasoning.</p>\n        <h3>Calibrating Reasoning Effort</h3>\n        <p>On <strong>o3-mini</strong>, you can calibrate how many reasoning tokens the model uses via the <code>reasoning_effort</code> parameter:</p>\n        <table><thead><tr><th>Effort Level</th><th>Latency</th><th>Best For</th></tr></thead><tbody>\n        <tr><td><code>low</code></td><td>Fastest</td><td>Straightforward code fixes, basic math, fast decision routing</td></tr>\n        <tr><td><code>medium</code> (default)</td><td>Balanced</td><td>General software engineering, data analysis, standard reasoning</td></tr>\n        <tr><td><code>high</code></td><td>Thorough</td><td>Complex mathematical proofs, competitive programming, intricate architecture design</td></tr></tbody></table>\n        <pre><code class="language-javascript">const response = await openai.chat.completions.create({\n  model: "o3-mini",\n  reasoning_effort: "high",\n  messages: [\n    { role: "developer", content: "You are a senior algorithmic engineer." },\n    { role: "user", content: "Optimize this dynamic programming solution for memory bounds." }\n  ]\n});</code></pre>\n        <h3>Developer Messages</h3>\n        <p>Reasoning models replace the legacy <code>system</code> role with the <strong><code>developer</code></strong> role, ensuring clear instruction hierarchy while preserving the model\'s safety and reasoning boundaries.</p>\n        <div class="ca-callout"><strong>\uD83D\uDCA1 Best Practice:</strong> Reasoning models natively support Structured Outputs (<code>strict: true</code>) and Function Calling, making them powerful reasoning engines for agentic workflows.</div>',quiz:[{q:"Which parameter controls the depth of reasoning tokens on o3-mini?",options:["temperature","reasoning_effort ('low' | 'medium' | 'high')","max_reasoning_tokens","thinking_depth"],correct:1,explanation:"The reasoning_effort parameter allows developers to trade off latency and token cost for reasoning intensity on o3-mini."},{q:"Which role replaces the 'system' message in OpenAI reasoning models?",options:["assistant","developer","supervisor","context"],correct:1,explanation:"OpenAI reasoning models utilize the 'developer' role for top-level behavioral instructions."},{q:"Do OpenAI reasoning models support Structured Outputs with JSON Schema?",options:["No, only plain text","Yes, with 100% adherence via strict: true","Only with temperature 0","Only via external parsers"],correct:1,explanation:"Reasoning models support Structured Outputs with strict: true JSON schema validation."},{q:"What is the operational status of the early o1-preview snapshot compared to production o1 and o3-mini?",options:["o1-preview is permanently required for API access","o1-preview was superseded by production o1 and o3-mini which add tool calling, structured outputs, and developer messages","o1-preview is only for offline training","o1-preview replaced GPT-4o"],correct:1,explanation:"The initial o1-preview snapshot was superseded by production o1 and o3-mini, which offer developer role support, structured outputs, function calling, and lower latency."}]}]},{name:"The GPT-4o Ecosystem",icon:"✨",color:"#10a37f",level:"EXPERT",desc:"Master the multimodal capabilities, high-speed vision processing, and cost optimization of the GPT-4o family.",lessons:[{title:"The GPT-4o Model Architecture",xp:200,duration:"10 min",lab:{title:"Execute GPT-4o Flagship Completion",xp:100,scenario:"Experience GPT-4o's high-speed multimodal inference engine. Fire a prompt testing temperature calibration.",steps:[{say:"POST to /v1/chat/completions targeting gpt-4o with deterministic temperature 0.0.",check:["curl","v1/chat/completions","gpt-4o","temperature.*0"],out:["{",'  "id": "chatcmpl_01Gpt4oFast",','  "choices": [{ "message": { "role": "assistant", "content": "The speed of light in vacuum is approximately 299,792,458 meters per second." } }]',"}"],hint:'Set model: "gpt-4o" and temperature: 0.0.',cmd:'curl https://api.openai.com/v1/c
1hat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o","temperature":0.0,"max_tokens":64,"messages":[{"role":"user","content":"What is the exact speed of light in vacuum?"}]}\''}]},content:'<h2>Omni-Modal Architecture</h2>\n        <p><strong>GPT-4o</strong> (<code>gpt-4o</code>) and <strong>GPT-4o-mini</strong> (<code>gpt-4o-mini</code>) are end-to-end multimodal models designed to natively process text, vision, and audio within a single neural network architecture.</p>\n        <h3>Model Comparison & Lifecycle Roster</h3>\n        <table><thead><tr><th>Model ID</th><th>Context Window</th><th>Max Output</th><th>Pricing (In / Out per MTok)</th><th>Lifecycle Status</th><th>Primary Strengths</th></tr></thead><tbody>\n        <tr><td><strong>GPT-6.1 Sol / Sol 6.1</strong></td><td>1.05M tokens</td><td>64,000 tokens</td><td>$3.50 / $14.00</td><td><span style="color:#10a37f">● ACTIVE (Flagship Reasoning)</span></td><td>Autonomous multi-agent orchestration, complex mathematical proofs, systems engineering</td></tr>\n        <tr><td><strong>GPT-6 Astra / Astra 6</strong></td><td>1.05M tokens</td><td>32,768 tokens</td><td>$4.00 / $16.00</td><td><span style="color:#10a37f">● ACTIVE (Flagship Omni)</span></td><td>Autonomous multi-tool routing, massive context retrieval, zero-overhead execution</td></tr>\n        <tr><td><strong>GPT-5.6 Terra / Luna</strong></td><td>256K - 512K tokens</td><td>32,768 tokens</td><td>Tiered ($0.30 - $2.50)</td><td><span style="color:#10a37f">● ACTIVE</span></td><td>Tiered deployment: Terra for balanced dev, Luna for fast edge</td></tr>\n        <tr><td><strong>GPT-4o</strong> (<code>gpt-4o-2024-11-20</code>)</td><td>128K tokens</td><td>16,384 tokens</td><td>$2.50 / $10.00</td><td><span style="color:#10a37f">● ACTIVE (Flagship)</span></td><td>Flagship multimodal vision, structured JSON outputs, streaming audio</td></tr>\n        <tr><td><strong>GPT-4o-mini</strong> (<code>gpt-4o-mini-2024-07-18</code>)</td><td>128K tokens</td><td>16,384 tokens</td><td>$0.15 / $0.60</td><td><span style="color:#10a37f">● ACTIVE (Recommended)</span></td><td>Ultra-fast, cost-efficient, high-volume classification, distilled student tasks</td></tr>\n        <tr><td><strong>o3-mini</strong></td><td>200K tokens</td><td>100,000 tokens</td><td>$1.10 / $4.40</td><td><span style="color:#10a37f">● ACTIVE (Reasoning)</span></td><td>Lightweight frontier reasoning with low/med/high effort and developer message role</td></tr>\n        <tr><td><strong>o1 (o1-2024-12-17)</strong></td><td>200K tokens</td><td>100,000 tokens</td><td>$15.00 / $60.00</td><td><span style="color:#10a37f">● ACTIVE (Deep Reasoning)</span></td><td>Autonomous reasoning for math proofs, competitive coding, and multimodal STEM logic</td></tr>\n        <tr><td><strong>GPT-3.5 Turbo (legacy)</strong></td><td>16K tokens</td><td>4,096 tokens</td><td>$0.50 / $1.50</td><td><span style="color:#ef4444">■ RETIRED / DEPRECATED</span></td><td>Superseded by gpt-4o-mini (lower price, higher intelligence, multimodal)</td></tr></tbody></table>\n        <h3>Structured Outputs & Tool Speed</h3>\n        <p>Both models feature near-instant time-to-first-token (TTFT) and support 100% reliable <strong>Structured Outputs</strong> and parallel function calling, making them ideal backbones for production agents.</p>',quiz:[{q:"What is the context window for GPT-4o and GPT-4o-mini?",options:["32K tokens","128K tokens","1M tokens","16K tokens"],correct:1,explanation:"Both GPT-4o and GPT-4o-mini feature a standard 128,000 token context window."},{q:"Which model is designed for high-volume, cost-sensitive classification and fast routing?",options:["GPT-4o","GPT-4o-mini","GPT-3.5 Legacy [RETIRED]","DALL-E"],correct:1,explanation:"GPT-4o-mini delivers high speed and low cost ($0.15/$0.60 per MTok) for high-throughput workflows."}]},{title:"Multimodal Vision & Realtime Execution",xp:300,duration:"15 min",lab:{title:"Analyze Multimodal Image Input",xp:200,scenario:"Use the Chat Completions API with GPT-4o to analyze a chart or UI mock-up and extract structured data.",steps:[{say:"Send a multimodal request containing image_url to GPT-4o.",check:["curl","chat/completions","gpt-4o","image_url"],out:["{",'  "choices": [{ "message": { "role": "assistant", "content": "The chart shows a 24% increase in quarterly throughput..." } }],','  "usage": { "prompt_tokens": 850, "completion_tokens": 45 }',"}"],hint:"Pass image_url inside the content array of a user message.",cmd:'curl https://api.openai.com/v1/c
1hat/completions -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"model":"gpt-4o","messages":[{"role":"user","content":[{"type":"text","text":"What is in this image?"},{"type":"image_url","image_url":{"url":"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-cross-plains-route.jpg/2560px-Gfp-wisconsin-madison-the-cross-plains-route.jpg"}}]}]}\''}]},content:'<h2>High-Precision Visual Analysis & Realtime Execution</h2>\n        <p><strong>GPT-4o</strong> represents OpenAI\'s flagship omni model, natively processing text, high-resolution imagery, and streaming audio in a unified neural network. In computer vision tasks, understanding its optical tokenization and resolution mechanics is essential for balancing visual fidelity, latency, and token economics.</p>\n\n        <h3>Image Tiling & Token Mechanics</h3>\n        <p>When sending images to GPT-4o, the <code>detail</code> parameter dictates the token consumption and sampling strategy:</p>\n        <ul>\n          <li><strong><code>detail: "low"</code> Mode:</strong> Downsamples the entire image to a 512x512 thumbnail, costing a fixed <strong>85 input tokens</strong> regardless of native dimensions. Ideal for basic classification, general scene description, and low-latency pipelines.</li>\n          <li><strong><code>detail: "high"</code> Mode:</strong> Scales the image to fit within a 2048x2048 bounding box, resizes the shortest side to 768px, and segments the image into a grid of 512x512 tiles. Each tile costs <strong>170 input tokens</strong>, plus the 85-token base overview. For example, a 1024x1024 image divides into 4 tiles, costing (4 	imes 170 + 85 = 765) tokens. This mode is vital for granular OCR, complex UI wireframes, and technical blueprints.</li>\n        </ul>\n\n        <pre><code class="language-javascript">import OpenAI from "openai";\nconst openai = new OpenAI();\n\n// High-precision OCR and structural extraction\nconst response = await openai.chat.completions.create({\n  model: "gpt-4o",\n  messages: [{\n    role: "user",\n    content: [\n      { type: "text", text: "Parse the data table from this financial receipt and return strict JSON." },\n      { \n        type: "image_url", \n        image_url: { \n          url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",\n          detail: "high" \n        } \n      }\n    ]\n  }],\n  response_format: { type: "json_object" }\n});\n\nconsole.log(response.choices[0].message.content);</code></pre>\n\n        <h3>The Realtime API (WebRTC & WebSockets)</h3>\n        <p>For conversational voice applications, GPT-4o powers the <strong>Realtime API</strong> (<code>/v1/realtime</code>). Rather than stitching together discrete STT (Speech-to-Text), LLM reasoning, and TTS (Text-to-Speech) pipelines—which introduces 1.5 to 3 seconds of perceptible delay—the Realtime API operates over a single low-latency bidirectional stream (~300ms latency):</p>\n        <ul>\n          <li><strong>WebRTC Transport:</strong> Recommended for mobile apps and browser clients for peer-to-peer audio streaming with built-in echo cancellation and jitter buffering.</li>\n          <li><strong>WebSocket Transport:</strong> Ideal for server-to-server telephony (e.g., Twilio SIP gateways) and custom audio backends streaming raw 24kHz PCM16 audio chunks.</li>\n          <li><strong>Server-Side VAD (Voice Activity Detection):</strong> Automatically detects when the human interrupts the model, immediately cutting off audio generation and pivoting the agent to listen.</li>\n        </ul>',quiz:[{q:"How does the 'high' detail parameter calculate image tokens in GPT-4o?",options:["It uses a fixed 85 tokens regardless of image size","It breaks the image into 512x512 tiles at 170 tokens each plus an 85-token base overview","It doubles token cost with no resolution benefit","It requires separate file uploads to S3"],correct:1,explanation:"In high detail mode, GPT-4o tiles images into 512x512 squares costing 170 tokens each, plus an 85-token base overview."}
1,{q:"What is the token cost of processing an image with detail: 'low' in GPT-4o?",options:["0 tokens","85 tokens fixed","170 tokens per tile","500 tokens"],correct:1,explanation:"Low detail mode downsamples the image to a 512x512 thumbnail and charges a flat 85 tokens."},{q:"What primary latency advantage does the GPT-4o Realtime API offer over chained STT -> LLM -> TTS pipelines?",options:["It runs offline","It processes native audio end-to-end, slashing latency from 2,000ms+ down to ~300ms","It does not use tokens","It only supports text"],correct:1,explanation:"Native omni-modal audio processing eliminates intermediate transcription and speech synthesis serialization, achieving natural conversational responsiveness."},{q:"How does the Realtime API handle human conversational interruptions?",options:["It crashes the connection","Server-Side VAD (Voice Activity Detection) immediately interrupts speech playback and listens to the user","The user must press a button to stop the AI","It ignores the user until finished speaking"],correct:1,explanation:"Server-side VAD detects incoming human speech in real-time and gracefully truncates the assistant's speech stream."}]},{title:"Prompt Caching & Batch API Economics",xp:250,duration:"12 min",lab:{title:"Calculate Compound Batch & Cache Discounts",xp:150,scenario:"Combine the 50% discount of the Batch API with Prompt Caching for massive savings on large datasets.",steps:[{say:"Submit a Batch request payload referencing a warm cached context prefix.",check:["curl","v1/batches","endpoint","completion_window"],out:["{",'  "id": "batch_01CompoundedEcon",','  "object": "batch",','  "endpoint": "/v1/chat/completions",','  "completion_window": "24h",','  "status": "validating"',"}"],hint:'POST to https://api.openai.com/v1/batches with endpoint "/v1/chat/completions".',cmd:'curl https://api.openai.com/v1/batches -H "Authorization: Bearer $OPENAI_API_KEY" -H "Content-Type: application/json" -d \'{"input_file_id":"file-batchEconomy101","endpoint":"/v1/chat/completions","completion_window":"24h"}\''}]},content:"<h2>Optimizing OpenAI API Economics</h2>\n        <p>OpenAI provides built-in mechanisms to dramatically reduce operational costs at scale:</p>\n        <h3>1. Automatic Prompt Caching</h3>\n        <p>For prompts with <strong>1,024 tokens or more</strong>, OpenAI automatically caches the longest prefix. Cache hits receive a <strong>50% discount on input tokens</strong> with zero manual cache configuration required.</p>\n        <h3>2. OpenAI Batch API</h3>\n        <p>For asynchronous workloads (batch processing, data labeling, model evaluation), the <strong>Batch API</strong> (<code>/v1/batches</code>) offers a <strong>flat 50% discount</strong> on all input and output tokens with results delivered within 24 hours.</p>\n        <h3>3. Model Distillation</h3>\n        <p>OpenAI allows developers to log outputs from frontier models (GPT-4o, o1) and distill that knowledge directly into fine-tuned GPT-4o-mini models, achieving high accuracy with massive latency and cost reductions.</p>",quiz:[{q:"What is the prompt threshold where OpenAI automatic Prompt Caching activates?",options:["100 tokens","500 tokens","1,024 tokens","4,096 tokens"],correct:2,explanation:"Prompts with 1,024 tokens or more are automatically cached by OpenAI's inference infrastructure."},{q:"What discount does the OpenAI Batch API provide on input and output tokens?",options:["10%","25%","50%","90%"],correct:2,explanation:"The Batch API offers a flat 50% discount on both input and output tokens for async workloads."}]},{title:"GPT-6 Astra, Sol 6.1 & GPT-Live-1 Voice API",xp:350,duration:"16 min",lab:{title:"Handshake with Realtime Audio Stream",xp:200,scenario:"Test bidirectional low-latency voice streaming. Connect to OpenAI's realtime WebSocket gateway.",steps:[{say:"Send an HTTP GET request with WebSocket upgrade headers to /v1/realtime.",check:["curl","v1/realtime","Upgrade.*websocket|Connection.*Upgrade"],out:["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade","Session established: session.created event emitted."],hint:'Include -H "Upgrade: websocket" and -H "Connection: Upgrade" targeting https://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview.',cmd:'curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Authorization: Bearer $OPENAI_API_KEY" -H "OpenAI-Beta: realtime=v1" "https://api.openai.com/v1/realtime?model=gpt-4o-realtime-preview"'}]},content:"<h2>September 2026 Frontier Releases</h2>\n        <p>In early September 2026, OpenAI introduced major frontier releases: <strong>GPT-6 Astra</strong> (Astra 6), <strong>GPT-6.1 Sol</strong> (Sol 6.1), and the production <strong>GPT-Live-1 API</strong> (launched September 10, 2026).</p>\n        \n        <h3>GPT-6 Astra (Astra 6) & GPT-6.1 Sol (Sol 6.1)</h3>\n        <p><strong>GPT-6 Astra</strong> and <strong>GPT-6.1 Sol</strong> represent OpenAI's next-generation frontier intelligence family. GPT-6 Astra leads multimodal omni-agent workflows with an extended 1.05M context window, high-fidelity image/video generation, and zero-overhead tool routing. GPT-6.1 Sol provides premier deep reasoning, mathematical proof synthesis, and autonomous architecture generation.</p>\n        <ul>\n          <li><strong>Extended 1.05M Context Window:</strong>
1 Massive context capacity with continuous sub-second token retrieval and automatic prefix caching.</li>\n          <li><strong>Autonomous Multi-Tool Calling:</strong> Executes complex parallel tool chains and MCP server integrations with zero-overhead syntax translation.</li>\n          <li><strong>Deep Integration with GPT-Live-1:</strong> Synchronizes live visual comprehension with sub-300ms conversational audio channels for sovereign voice agents.</li>\n        </ul>\n\n        <h3>GPT-Live-1 API (Launched September 10, 2026)</h3>\n        <p>The <strong>GPT-Live-1 API</strong> is OpenAI's dedicated production API surface for fluid, low-latency conversational audio. Unlike traditional cascaded STT → LLM → TTS pipelines, GPT-Live-1 processes native audio streams with sub-300ms latency, supporting:</p>\n        <ul>\n          <li><strong>Barge-In & Interruption:</strong> The model gracefully yields when the user begins speaking without audio artifacts or buffer drift.</li>\n          <li><strong>Emotional Affect & Intonation:</strong> Understands user vocal inflection and adjusts speech cadence, tone, and pacing in real time.</li>\n          <li><strong>WebRTC & WebSocket Transport:</strong> Operates over standard WebRTC data and media channels for browser, mobile, and IoT clients.</li>\n        </ul>\n\n        <h3>Comprehensive SOE + AOE Checklist for OpenAI Workloads</h3>\n        <table><tr><th>Discipline</th><th>Requirement</th><th>Implementation Details</th></tr>\n        <tr><td><strong>SOE Baseline</strong></td><td>Organization & Key Isolation</td><td>Separate production and dev organizations with independent TPM/RPM quotas; store keys in AWS Secrets Manager or Azure Key Vault.</td></tr>\n        <tr><td><strong>SOE Versioning</strong></td><td>Model Pinning</td><td>Never use dynamic aliases in production; pin exact snapshot IDs (e.g., <code>gpt-4o-2024-11-20</code>, <code>o3-mini</code>) to avoid silent behavioral drift.</td></tr>\n        <tr><td><strong>AOE Operations</strong></td><td>Automated Fallback & Moderation</td><td>Pre-screen every prompt via the free <code>omni-moderation-latest</code> endpoint; implement automatic circuit breaking from primary models to <code>gpt-4o-mini</code> on 503 or 429 errors.</td></tr>\n        <tr><td><strong>AOE Cost Telemetry</strong></td><td>Prompt Cache Monitoring</td><td>Instrument telemetry to track <code>prompt_tokens_details.cached_tokens</code> vs total tokens; alert if cache hit ratio drops below 70% on high-volume routes.</td></tr></table>",quiz:[{q:"What key architectural capabilities are introduced in OpenAI's Astra 6 and Sol 6.1 model family?",options:["Text-only 4K context with no tool calling","1.05M context window, native zero-overhead multi-tool calling, deep reasoning, and sub-300ms integration with GPT-Live-1","Requires external audio transcoding pipelines","Only runs locally on specialized ASIC chips"],correct:1,explanation:"GPT-6 Astra and Sol 6.1 deliver an expanded 1.05M context window, autonomous tool routing, and direct streaming integration with GPT-Live-1."},{q:"When was the dedicated GPT-Live-1 API launched by OpenAI?",options:["January 2024","September 10, 2026","November 2022","May 2025"],correct:1,explanation:"The GPT-Live-1 API was officially launched on September 10, 2026, enabling ultra-low-latency real-time voice experiences."},{q:"What is a primary advantage of the GPT-Live-1 API over cascaded STT-LLM-TTS pipelines?",options:["It requires dial-up modems","Sub-300ms end-to-end latency with native audio processing, interruption handling, and natural emotional affect","It only generates text","It costs 10x more than human operators"],correct:1,explanation:"Native multimodal speech processing eliminates cascade latency and supports natural real-time conversation dynamics."},{q:"What is an essential AOE requirement for production OpenAI API deployments?",options:["Use dynamic latest model aliases in production","Pre-screen prompts with omni-moderation-latest, pin exact model snapshots, and monitor prompt c
1ache hit ratios","Disable retry logic","Delete telemetry logs"],correct:1,explanation:"Production AOE mandates pre-moderation, explicit model snapshot pinning, circuit-breaker fallbacks, and active cache telemetry."}]}]}]}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.