-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: No token found - OPENAI_API_KEY environment variable #52
Comments
I tried by creating a new account, which comes with 5$ credit, change key, but still the same error. |
I have the same issue! |
Same as of today. |
Hi all, I'm looking into this right now |
@PJV-Ecu / @vertesy / @roman-gallardo - I think this is more likely due to an invalid token, can you try running this and let me know? library(httr2)
Sys.setenv("OPENAI_API_KEY" = "sk-...")
request("https://api.openai.com/v1/models") %>%
req_auth_bearer_token(Sys.getenv("OPENAI_API_KEY")) %>%
req_perform() If your token is valid you should see this: <httr2_response>
GET https://api.openai.com/v1/models
Status: 200 OK
Content-Type: application/json
Body: In memory (9051 bytes) If your token is not valid, which is what I think it is, you should see: Error in `req_perform()`:
! HTTP 401 Unauthorized.
Run `rlang::last_trace()` to see where the error occurred. If you do get |
Thank you. Here is my output
So I think my error is elsewhere |
Thank you @roman-gallardo, would you mind trying this? library(httr2)
Sys.setenv("OPENAI_API_KEY" = "sk-...")
request("https://api.openai.com/v1/models") %>%
req_auth_bearer_token(Sys.getenv("OPENAI_API_KEY")) %>%
req_perform()
chattr::chattr("hello") |
I tried it and got the following output:
I think I exceeded my quota because I tried inputting text using the chattr_app() function so many times. I guess I have to wait until my quota is reset? I am not sure when it resets. |
Oh ok, thank you for testing, so, it is validating your token... would you mind running the app again, and see if the error you get is the "no token" error? Because if it is that, then I need to work on improving error messages |
sure. here is the output when I run chattr_app(). `> chattr_app() Listening on http://127.0.0.1:5937
|
Thank you! So yeah! I need to improve what the error needs to say, thank you for testing! |
Thanks, @edgararuiz for following this up. My token is ok according to your instructions. The error message when trying to run a query in the "chattr_app()" pop-up prompt is the following:
Listening on http://127.0.0.1:6815
|
Hi, I have the same error and tried the same debugging. So, if I get it right, the problem is not related to maxing out the quota? |
I run into a similar problem using chattr. Can anyone help? Thanks
Listening on http://127.0.0.1:6153
|
I get the same error aswell |
Same here, chattr::chattr_app() works though (please check spelling mistake: "✔ Connection with OpenAI cofirmed") Update (1/17/24): it worked for me today somehow. |
Hello, I got the same issue when I ran chattr_app() and sent prompts: Listening on http://127.0.0.1:6693
|
I have the same issue as Janine-KKK: Listening on http://127.0.0.1:4123
|
chattr_app() Listening on http://127.0.0.1:6732
|
Hi @cargingarsan , can you run the following and letting me know what you got? library(httr2)
request("https://api.openai.com/v1/models") %>%
req_auth_bearer_token(Sys.getenv("OPENAI_API_KEY")) %>%
req_perform() |
Hi, I was experiencing similar symptoms to those of the users mentioned above and thought I'd leave a note in case it might give you a clue. Symptoms1. httr2 responseWhen executed below code, It returns 200. library(httr2)
Sys.setenv("OPENAI_API_KEY" ="sk-...")request("https://api.openai.com/v1/models")
%>%
req_auth_bearer_token(Sys.getenv("OPENAI_API_KEY")) %>% req_perform()
This doesn't effected from type of API secret key (either user API key or Project API key) 2. chattr optionsWhen I use 3. chattr viewerWhen I use 4. chattr Error "character", "httr2_response" message(see #52 (comment)) My status1. VersionsI used
2. APII'm using the ChatGPT Plus Subscription. (sorry for korean) At the same time, I saw error @cargingarsan mentioned
ClueAfter trying various things to use I didn't realize that chatGPT subscription and openAI API subscription are treated separately. Since I don't have any intention of using the openAI API, so I won't be trying to utilize (However, I understand as Gemini provides API freely, if Thanks. |
Hi Thanks for creating this package!
I am trying to use it, but i get an error, when I submit my first request!
print(Sys.getenv("OPENAI_API_KEY"))
is correctThe text was updated successfully, but these errors were encountered: