Overview
Just like many others I’ve been very excited about using ChatGPT.
Here is a simple example of how you can integrate your own project with ChatGPT.
Alternatively you can checkout this simple proof reader I made using ChatGPT.
Pre Requisites
You need to setup a billing account.
https://platform.openai.com/account/billing/payment-methods
You need to create an API key.
https://platform.openai.com/account/api-keys
Store your API Key securely.
Note, I store it at the machine level but you could do this at process or user level.
e.g. Windows PC
1 | [System.Environment]::SetEnvironmentVariable('MY_OPEN_AI_API_KEY', 'your-sdk-api-key-value', 'Machine') |
SDK
I opted to use a SDK to integrate with ChatGPT’s API.
Here is their list of official SDK’s.
I opted for a C# library, Betalgo/OpenAi by Betalgo.
Sample Code
1 | using OpenAI.GPT3; |