44
Views
6
Comments
Solved
[ChatGPT] How can I set the ChatGPT API key?
chatgpt
Service icon
Forge asset by Leonardo Pires
Application Type
Service

Hello everyone,

When I try to use the server action "ChatGPT_ChatCompletions", the system shows the error message "No secret key was registered! ". 

How can I register the key in Outsystems?

BR
Manuel 

2023-01-05 17-39-49
Leonardo Pires
Champion
Solution

Hey Manuel,

It is not being used itself, perhaps you have removed it by clicking on site properties, as it is not a public item, we need it through a public action.

Try to reinstall again and set the API_Key value in the service center to avoid displaying it in your project.

Try to do or test again.


Regards.

2023-01-05 17-39-49
Leonardo Pires
Champion

Hi Manuel.

You need create your own ApiKey in OpenAi, follow the tutorial in documentation.


King regards

UserImage.jpg
Manuel Schwarz

Dear Leonardo, 

Thank you for your reply! I generated an OpenAi key as documented:

Createded the Site Property as Secret:

And tried to assign execute it:

But the result is the same. The system shows the error message "No secret key was registered! ".  

How can I apply/assign the key in Outsystems?

Thank you!

BR
Manuel 

2023-01-05 17-39-49
Leonardo Pires
Champion

Hi Manuel

You need set site properties ChatGPT_SECRET_KEY with your ApiKey in this module or service center.






Regards 

UserImage.jpg
Manuel Schwarz

Dear Leonardo, 

Thank you very much for your fast reply. The secret is set but it still does not work. 
1.) ChatGPT_SECRET_KEY is set based on the key generated on the OpenAI website

Is the name of the property "ChatGPT_SECRET_KEY" correct because in one of your documentations the property "ChatAI_SECRET_KEY" is mentioned? Is the property maybe case sensitive?


Is it required to run the Server Action "ChatAI_SECRET_KEY"?

FYI - The name of the Server Action indicates the "ChatAI_SECRET_KEY" and not the site property "ChatGPT_SECRET_KEY".


Is it required to assign the site property somewhere?

The systems shows this warning:

Unused Element > Site Property 'ChatGPT_SECRET_KEY' is never used in Module 'Experience'. Consider deleting it.


Thank you very much for your help!


BR
Manuel 

2023-01-05 17-39-49
Leonardo Pires
Champion
Solution

Hey Manuel,

It is not being used itself, perhaps you have removed it by clicking on site properties, as it is not a public item, we need it through a public action.

Try to reinstall again and set the API_Key value in the service center to avoid displaying it in your project.

Try to do or test again.


Regards.

UserImage.jpg
Manuel Schwarz

Dear Leonardo, 

it works 🥳

A simple reinstallation solved the problem! 

Thank you very much!

BR
Manuel 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.