How to use OpenAI capabilities on your own website?

By now, you all may be aware of OpenAI and ChatGPT and the immense potential it holds. In case you want to read more about ChatGPT I would highly recommend that you read the below article from our website:

OpenAI offers users many unique AI systems such as with GPT-3 (the brain behind ChatGPT) to perform natural language tasks or Codex that translates natural language to code or DALL-E that can create realistic images and art from a description provided in natural language.

You can of course try out the capabilities of these models on OpenAI website as below:

https://openai.com/

The exciting piece of information is that you can harness the capabilities of these fundamentally future altering AI models to build your own unique apps. This is possible using the OpenAI API. The API is powered by a set of models with different capabilities and price points. There is also an option to customize the base models for industry specific use cases with finetuning.

Note: As mentioned above, APIs are not free and based on a “Pay as you go” pricing model. You can start for free for $18 in free credit that can be used during your first 3 months.

You can review below link for pricing details for various AI models.

https://openai.com/api/pricing/

To access the OpenAI API, you need to create an account at the below link:

https://openai.com/api/

Click on “Get Started” button. You are required to create an account or login with an existing account

Click Personal-> View API Keys

Click “Create new Secret Key”

The system generates API keys. Make sure to note and save the secret key to a safe and accessible location.

I will be using a WordPress Plug-in to integrate OpenAI to my website using the above API.

For this I navigate to my WordPress Admin Page and click on “Plugins” and then click “Add New”

To demonstrate the capabilities of OpenAI using API, I will choose the below plug-in

GPT AI Power

We will demonstrating the content generator capability of this plug-in.

Note: There are several OpenAI related plug-ins already available for WordPress. I selected one which has high downloads and good reviews.

Click “Install Now” and then click “Activate”

Click on “GPT AI Power” and provide the information as required in the screenshot:

API Key: The OpenAI key generated above

Retain the remaining default options and click “Save”

Click on “Content Writer” and you will be navigated to below page:

Provide Title: “Hyderabadi Biryani”

Click “Generate”. I noticed that I received the below error “You exceeded your current quota, please check your plan and billing details.”

It seems I had exhausted all the trial credits of my free account. So I upgraded my OpenAI account to a paid account.

Note: OpenAI has a feature to set hard limits in USD (post which subsequent requests will be rejected) and soft limits in USD (at which time a notification email will be sent to the account owner).

After making this update, I tried running the request again and it started to work

It took approximately 1 minute and 30 seconds to generate the entire article.

You can make edit and Save Draft.

Once I click “Save Draft”, it opens a draft page of the article which I can further edit or publish as needed

Closing Thoughts: I believe the OpenAI is a game changer as it will allow businesses to focus on their own unique use cases by leveraging the immense potential of these APIs in the background.

In subsequent blog posts, I will try to explore other API capabilities such as code generation , image generation etc.

Leave a Reply

Your email address will not be published. Required fields are marked *