In this tutorial, you will learn how to create an API key on the OpenAI platform and configure it in Scriptcase AI to use the intelligent features available in your projects.
Obtaining the OpenAI API key
1. Access the OpenAI platform with your account.
2. After logging in, access the API keys area.

3. Click the option to create a new API key.

4. Define a name and click Create secret key.
The name is optional, but we recommend using an identification that makes it easier to manage it later in the list of keys.

For more details about creating and managing API keys, see the official OpenAI documentation.
5. After generating the key, copy the displayed code and store it in a safe place.
Save the secret key, as it will not be possible to view it again. Keep it protected, since anyone with your API key can make requests on your behalf. If you lose it, you will need to generate a new one.

API Key Management
On the API Keys screen, it is possible to manage the created keys.
In the column highlighted in the image below, you can access the key management options, such as editing permissions or deleting the key.
The complete key is only displayed at the time of creation. If you lose or do not save the key, you will need to create a new one and update the configuration in Scriptcase AI.

Configure Scriptcase AI
1. After logging in with an administrator account in Scriptcase, access the Tools > Scriptcase AI menu.
2. Copy the generated API key and paste it into the API Key field.
In this step, enable the option to create and translate applications automatically and select the OpenAI Provider, as well as the Chat Model and Smart Tasks Model.

- Project access permissions
In the project list, define the access permissions of Scriptcase AI for each project.
Enable Code View and grant access to the connections so that Scriptcase AI can analyze the code of the open event and access the structure of the database tables and fields.
Scriptcase AI accesses only the database structure, such as tables and fields. It does not access or read the data stored in the database.

4. After entering the information, click save settings.
The chat and smart tasks are now available. See more details about the options on the configuration screen in our documentation.
