MAUIverse MAUIverse

Building a ChatGPT in .NET MAUI Part 1

The first part of this series is about the plumbing. Daniel Monettelli explains how to pick the OpenAI parameters that matter for your app’s business logic, then follows the request and response flow for both text completions and image generation using diagrams.

He then moves to the service layer. An OpenAIService sets up an HttpClient with the base address, a bearer token header and a JSON Accept header. AskQuestion and CreateImage serialize a request object, post it to the matching endpoint, and deserialize the response into the first text result or image URL.

The code is based on a talk by Luis Beltran, and Daniel links to his tutorial video and to the open-source dotnetmaui-chatgpt-oss repository. The post also notes that it was written with help from GPT-3.

It’s a useful starting point if you want to see the HTTP side of an OpenAI integration before the UI gets involved.

View Source →

← Back to Community Feed

}