AuthenticationError: Unauthorized, please check your credentials. - Invalid API key
I am using the new template system. I already added .env api key but still got the error
AuthenticationError: Unauthorized, please check your credentials. - Invalid API key, please visit https://e2b.dev/docs/api-key for more information. authorization header is missing
Hi @bilalmalkoc, when using the .env file, do you have also the the dotenv installed and imported in the build file?
(https://e2b.dev/docs/template/quickstart#create-a-development-build-script) JS
import "dotenv/config";
Python
from dotenv import load_dotenv
load_dotenv()
If none of this works, you can also specify the API Key directly: https://e2b.dev/docs/template/build
Template.build(template, {
...
apiKey: 'your-api-key', // Override API key
})
yes alread installed dotent (node) and imported, still not working.
it is working when i put config directly.
and if you set it in your env?
export E2B_API_KEY=...
make sure also that you load the env variable in your build script, not template file (if you have them separate)
@mishushakov tried both no luck.
can you share the code? how are you running it?