Skip to content
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

[E2B-402] Improve SDK error message when API key is missing #177

Closed
mlejva opened this issue Sep 29, 2023 · 1 comment
Closed

[E2B-402] Improve SDK error message when API key is missing #177

mlejva opened this issue Sep 29, 2023 · 1 comment
Assignees
Labels
Improvement Created by Linear-GitHub Sync SDK Created by Linear-GitHub Sync

Comments

@mlejva
Copy link
Member

mlejva commented Sep 29, 2023

This is the current message

throw new AuthenticationError('API key is required, please visit https://e2b.dev/docs to get your API key');
AuthenticationError: API key is required, please visit https://e2b.dev/docs to get your API key

We should mention that users can either pass the API key or set an environment variable. This is how OpenAI does it when you don't specify the API key

in JS SDK:

throw new Error("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'my apiKey' }).");
                  ^

Error: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'my apiKey' }).

in Python SDK:

No API key provided. You can set your API key in code using 'openai.api_key = <API-KEY>', or you can set the environment variable OPENAI_API_KEY=<API-KEY>). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = <PATH>'. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.

From SyncLinear.com | E2B-402

@mlejva mlejva added Improvement Created by Linear-GitHub Sync SDK Created by Linear-GitHub Sync labels Sep 29, 2023
@jakubno jakubno self-assigned this Jan 23, 2024
@jakubno
Copy link
Member

jakubno commented Jan 23, 2024

Solved by #293

@jakubno jakubno closed this as completed Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Created by Linear-GitHub Sync SDK Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

2 participants