I’m trying to get my Open AI API key (tested on Postman, it works) to work in Adalo as a custom action tied to a button. I’ve updated my API across my adalo account and double checked it in this action.
I have rewritten/double checked my code many times and still get this error no matter what. Has anyone else had this?
"An error occurred when performing your API request
Request failed with status code 401
Full Response:
{
“error”: {
“message”: “You didn’t provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you’re accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.”,
“type”: “invalid_request_error”,
“param”: null,
“code”: null
}
}
My code is as follows:
API Base URL
https://api.openai.com/v1/completions
Method
POST
Headers
Content-Type: application/json
Authorization: Bearer MY_API_KEY
Body
{
“model”: “gpt-3.5-turbo-instruct”,
“prompt”: “MY_PROMPT”,
“max_tokens”: 500
}