
The introduction of this course.
The introduction of the course tutor.
A brief introduction of what GPT is.
A brief introduction of the different generations of OpenAI's GPT models.
A brief introduction of the choices of GPT models.
The requirements for users to use advance models.
A preliminary notice for subscribers.
Steps of how to create an account on the OpenAI website.
Steps of how to set up a valid payment method.
Steps of how to create a secret API key.
An instruction of the installation of Visual Studio 2022.
The quick start video demonstrates how to utilize the info provided by ChatGPT to create a working C# Blazor Server App to access OpenAI API.
The full content of the steps provided by ChatGPT for creating a working Blazor Server App to access OpanAI API. (ps: These steps contain some minor errors, the corrective actions are provided in the previous video.)
A detailed explanation of how the Blazor Server App created earlier works.
An introduction of how to protect the secret API key in your app.
The project file is used in sections 4 to 6.
The explanation of the parameters of the request body (aka Prompt) needed for the OpenAI API.
The explanation of the parameters of a chat completion object needed for the OpenAI API.
Steps to create chat completion classes using C#.
Steps to modify the Chat Completion method provided by ChatGPT for better usage.
Explanation of the parameters, finish_reason, and usage tokens.
Steps to beautify front page of the Blazor Server App.
The explanation of what streaming mode is and how it works.
Add new property for the request body class to activate streaming mode.
Create classes used to receive chat completion chunks from the chat completion API under the streaming mode.
Create a new IAsyncEnumerable method to process transactions with the chat completion API in streaming mode.
Modify the index.razor page to reflect the change for processing the streaming mode.
Create the method to convert markdown characters included in the chat completion chunk objects into HTML tags.
Display the token usage info on the front-end to the users
Add the error handling methods to manage API exceptions.
The first "Hello World!" code using the official OpenAI .NET Library. Connection methods used in this video are non-streaming mode.
Modify the non-streaming "Hello World!" program into the streaming mode by using the asynchronous streaming methods of the official .NET Library.
Explain the differences between the API we created from scratch shown in the previous videos and the official OpenAI .NET Library.
Create a new outfit for the new .NET 8 Blazor Web App that are going to be used with the OpenAI .NET Library.
Install the OpenAI .NET Library from the NuGet package management.
Build the non-streaming API access methods using the official .NET Library.
Build the asynchronous streaming API access methods using the official .NET Library.
Retrieve the Finish Reason and the token Usage info by using the official .NET Library.
Add extra option settings and system messages to the function call using the official .NET Library.
ToolCalls enable GPT to call your external functions dynamically.
Implements tool calls in non-streaming sync API with loop logic.
Adapts tool call logic for async non-streaming API behavior.
Demonstrates triggering multiple tools at once.
Introduces helper classes to build streaming ToolCalls incrementally.
Implements synchronous streaming with support for ToolCalls processing.
Implements asynchronous streaming with support for ToolCalls processing.
Centralizing tool registration via ToolRegistry for reusable integration.
Options and limitations in enforcing tool usage.
Understand how OpenAI image generation works, how the Image API fits into an application, and how it differs from model-driven image generation workflows.
Prepare the Project Template
Use the official OpenAI .NET library to generate an image from a prompt and save the returned image data as a local file.
Configure image size and quality with image generation options and observe how these settings affect the generated result.
Connect generated image files to the Blazor chat interface, display responsive images, and provide feedback while image generation is in progress.
Let the chat model trigger image generation through a custom tool and create multiple images from separate prompts in a single user request.
Explains the core concepts of OpenAI’s Image API, compares DALL·E and gpt-image-1 models, and clarifies their capabilities, limitations, costs, and usage scenarios before coding.
Prepares a clean Blazor project template for image generation.
Generate images using OpenAI's Image API with cloud URL output.
Improve image UI with loading dots and thumbnail previews in Blazor.
Configure DALL·E 3 image output using quality, size, style, and format options.
Generate Base64 images, embed them in Blazor UI, and preview via a modal.
Convert Base64 image data into local server-side image files for persistent access.
Integrate the Image API as a ToolCall for multi-tool Chat Completion workflows.
Use Blazor JS interop to trigger image modals from inline .NET code.
Enable multi‑turn memory by sending the full chat history to the model.
Generate multiple Base64 images in one request using the gpt-image-1 model
Generate multiple images by combining results from multiple tools in one prompt.
Learn how to integrate OpenAI APIs into real C# applications using both direct HTTP requests and OpenAI's official .NET library.
Most Generative AI tutorials are built around Python. But if you are already a C# developer, you should not have to switch languages just to understand how modern AI APIs work.
This course takes a hands-on, C#-first approach.
Instead of hiding everything behind a framework, we begin by working directly with the OpenAI API so you can understand what is actually being sent in a request and returned in a response. We then move to OpenAI's official .NET library and build progressively more capable applications using streaming responses, Tool Calls, multiple tools, and image generation.
Throughout the course, you will build working Blazor applications and see how the individual API concepts fit together in a real application.
What You Will Learn
You will learn how to:
Understand the relationship between GPT models, ChatGPT, and the OpenAI API
Set up an OpenAI account and securely use an API key
Call OpenAI APIs directly from C# using HttpClient
Understand the structure of chat requests and responses
Process responses using both non-streaming and streaming workflows
Work with system messages, API options, finish reasons, and token usage
Use OpenAI's official .NET library in C# applications
Build asynchronous and streaming chat experiences
Extend a model with your own C# functions through Tool Calls
Register and orchestrate multiple tools in the same application
Let the model decide when external tools should be invoked
Generate images using the OpenAI Image API
Configure image generation options such as image size and quality
Save generated images and make them available to your application
Combine Chat Completion Tool Calls with image generation
Generate multiple independent images from a single user request
Integrate OpenAI capabilities into interactive Blazor Web Apps
Learn the API, Not Just the Syntax
One of the goals of this course is to help you understand what happens behind the code.
You will first work with the API more directly so you can see the request and response structures yourself. After that foundation is established, we move to OpenAI's official .NET library and see how the SDK represents those same concepts through strongly typed C# classes.
This makes it easier to understand not only how to write the code, but also why the code works.
Build with OpenAI's Official .NET Library
The second half of the course focuses on practical development using the official OpenAI .NET library.
You will work with chat completions, streaming responses, Tool Calls, multiple tools, and image-generation workflows while progressively extending the same application.
Rather than treating these capabilities as isolated examples, the course demonstrates how they can work together inside a real C# application.
Go Beyond Chat with Tool Calls
A language model becomes much more useful when it can interact with functionality outside the model itself.
You will learn how to expose your own C# functions as tools, allow the model to decide when those tools are needed, process tool-call arguments, return results to the model, and coordinate multiple tools within the same request.
The course also demonstrates how a chat model can trigger an image-generation tool, combining conversational reasoning with the OpenAI Image API.
Generate Images with the OpenAI Image API
The image-generation section has been rebuilt around the current GPT Image workflow.
You will generate images from text prompts, configure image-generation options, save generated image data to local files, display the results in a Blazor application, and provide progress feedback while longer image requests are running.
You will then take the workflow one step further by connecting image generation to Tool Calls and generating multiple independent images from a single natural-language request.
Earlier OpenAI image-generation lessons are retained separately as a legacy archive for students who want to compare previous workflows with the updated implementation.
Hands-On Blazor Projects
This is not a slide-only course.
You will build and modify working C# applications throughout the course, including interactive Blazor Web Apps that communicate with OpenAI APIs, stream model responses, execute tools, and display generated images.
The examples are intentionally developed step by step so you can understand how each capability is added to the application.
Who Is This Course For?
This course is designed for:
C# developers who want to start building applications with Generative AI
.NET developers who want practical experience with the OpenAI API
Developers who want to understand both direct REST API access and the official OpenAI .NET library
Engineers interested in streaming responses, Tool Calls, and AI-powered application workflows
Blazor developers who want to integrate OpenAI capabilities into web applications
Developers coming from traditional application development who want a practical path into Generative AI
You do not need Python experience.
Prerequisites
You should have:
Enthusiasm for learning Generative AI development with C#
Basic knowledge of C# programming
Experience with ASP.NET Core or Blazor is helpful, but not required to understand the OpenAI API concepts covered in the course.
A Practical Foundation for Building AI Applications with C#
OpenAI's APIs and models continue to evolve, but the fundamental application patterns remain important: sending structured requests, processing responses, streaming output, calling external tools, and integrating generated content into your own application.
This course focuses on those practical foundations and shows how to implement them using C# and the .NET ecosystem.
If you are ready to move beyond simply using ChatGPT and start building your own AI-powered applications, let's get started.