Search in docs... K
You can get your API key by signing up. Sign up to get your API key
To use the API key, you either:
- Set the API key as the
E2B_API_KEY
environment variable - Or pass it directly to the
CodeInterpreter
constructor like this:
from e2b_code_interpreter import CodeInterpreter
with CodeInterpreter(api_key="YOUR_API_KEY") as code_interpreter:
sandbox.notebook.exec_cell("x = 1")
execution = sandbox.notebook.exec_cell("x+=1; x")
print(execution.text) # outputs 2
CopyCopied!