An artificial intelligence research and deployment company, OpenAI focuses on the creation of safe, artificial, general intelligence. Their latest AI model, called ChatGPT, has the ability to interact with a user in a conversational tone.
When prompted, it composes responses relevant to the topic requested. Thunkable creators can utilize this model in their own apps and tap into the power of AI and natural language generation.
Create an OpenAI account and generate a secret API key
To use the OpenAI ChatGPT model in your Thunkable app, you need to generate a personal Open AI API key. To do this:
On the Overview page, click your avatar to show the menu and select View API Keys.
Select Create new secret key.
Copy the secret key that is provided in the popup window. You will need to paste this into your Thunkable project.
You will only be able to see your OpenAI API key once. You will not be able to copy it after the initial modal closes.
OpenAI Integration Setup in Thunkable
To setup the OpenAI integration in Thunkable:
Navigate to your project’s Blocks tab.
Scroll to the bottom of the blocks panel on the left side to access the Advanced section.
Click the expand chevron to show the Advanced components.
Click the plus icon next to Open AI Services.
Your “Open AI Services” component will appear under the Open AI Services (Beta) drawer. Click the gear icon next to the component's name to access its properties dialog.
Paste your Open Secret API Key in the text box under APIKey (currently set to ‘default’).
Click Submit.
Properties
API Key
Property
Description
Data Type
API Key
Your person API for making requests to the OpenAI API (default key used if this field is left blank)
Text
Request Settings
Request Settings are passed as a list of Objects, or key-value pairs. In this modal, you can pass the property name and property value in their own fields.
See what kind of settings you can pass in OpenAI's Making Requests documentation.
Property
Description
Data Type
Property
Name of the property you are assigning a value to in your API request
Text
Value
Value of the property you are specifying in your API request