Skip to content

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

1 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

Repository files navigation

OpenAI API Quickstart - CSharp example app

This is an example pet name generator app used in the OpenAI API quickstart tutorial. It uses the .NET 7.0 framework.

Text box that says name my pet with an icon of a dog

Setup

  1. If you don’t have .NET SDK 7.0 installed, install it from here

  2. Clone this repository

  3. Generate OpenAi API key here

  4. Paste API key value to appsettings.json file in following section:

      "OpenAiConfig": {
        "ApiKey": "<paste your key here>"
      }
  5. Navigate into the project directory

    $ cd openai-quickstart-csharp/OpenAiQuickStartCSharp/
  6. Run the app

    $ dotnet run
  7. Test your app:

    Open app web page http://localhost:5078/

    Or use curl:

    $ curl --location 'http://localhost:5078/OpenAi' --header 'Content-Type: application/json' --data '{ "Animal": "Cat"}'

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages