# Form Designer (ASP.NET webforms) integration with OpenAI's .NET API

**URL:** <https://discuss.workflowgen.com/t/form-designer-asp-net-webforms-integration-with-openais-net-api/2272>\
**Category:** Integration\
**Created:** [January 24, 2025, 6:47pm UTC](https://discuss.workflowgen.com/t/form-designer-asp-net-webforms-integration-with-openais-net-api/2272 "2025-01-24T18:47:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [January 24, 2025, 6:47pm UTC](https://discuss.workflowgen.com/t/form-designer-asp-net-webforms-integration-with-openais-net-api/2272/1 "2025-01-24T18:47:59Z")

</div>

Discover how to integrate the powerful capabilities of [OpenAI’s .NET API](https://www.nuget.org/packages/OpenAI) into your WorkflowGen Form Designer (ASP.NET webforms) with this sample implementation.

By combining the flexibility of WorkflowGen’s process automation with the intelligence of OpenAI’s API, you can unlock a variety of innovative possibilities. For example, you can automate content generation, create intelligent form validation that adapts to user inputs, and provide contextual suggestions and completions directly within your forms, enhancing user experience.

This article walks you through the essential configurations and setup to help you seamlessly integrate OpenAI into your WorkflowGen-powered workflows.

> **Note:** The example is for illustrative purposes only. It’s crucial to properly sanitize any user-provided input data before sending messages to the chat.

## Getting started

### References

- [OpenAI NuGet Package](https://www.nuget.org/packages/OpenAI): This link includes additional integration examples and detailed how-to guides for leveraging the OpenAI .NET API.

### Prerequisites

- The API key from your OpenAI account.

### Configuring the webforms IIS web app

1. Install the OpenAI NuGet package.

2. Add or update the `\wfgen\wfapps\webforms\web.config` file to target `.NET Framework 4.8` and reference all the packages and dependencies (including `netstandard 2.0`) if this isn’t already the case. The content of the file should look like this:

### Sample process configuration in WorkflowGen

1. Import the [OPENAI\_DOTNET\_API\_CHATv1.xml](https://download.workflowgen.com/forum/openai-dotnet-api/OPENAI_DOTNET_API_CHATv1.xml) sample process XPDL into WorkflowGen.

2. Set your OpenAI API key in the form code-behind. To do this:

3. You should now be ready to launch a new request and start sending chat messages to OpenAI within your webform.
