Skip to content

Instantly share code, notes, and snippets.

@nehiljain
Created October 6, 2024 01:56
Show Gist options
  • Save nehiljain/d194244d5aba913592a627f07545a13c to your computer and use it in GitHub Desktop.
Save nehiljain/d194244d5aba913592a627f07545a13c to your computer and use it in GitHub Desktop.
E2B Docs Readme

Home

Search in docs... K

Home

Docs Dashboard

Your API Key

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:

JavaScript & TypeScript

Python

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment