> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wrenn.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Tour

> Install the Wrenn Python SDK, set your API key, and run your first capsule in four steps. Includes a code interpreter example.

Wrenn runs your code inside isolated virtual machines called capsules. This guide walks you through installing the SDK, authenticating, and running your first command — all in a few minutes.

<Note>
  The Wrenn SDK requires Python 3.13 or later.
</Note>

<Steps>
  <Step title="Install the SDK">
    Install the `wrenn` package from PyPI:

    ```bash theme={null}
    pip install wrenn
    ```
  </Step>

  <Step title="Set your API key">
    Generate an API key from the [Wrenn dashboard](https://app.wrenn.dev) and export it as an environment variable:

    ```bash theme={null}
    export WRENN_API_KEY="wrn_your_api_key_here"
    ```

    The SDK reads `WRENN_API_KEY` automatically — you don't need to pass it in code.

    <Tip>
      Pass `wait=True` when creating a capsule to block until it reaches the `running` state before you start sending commands.
    </Tip>
  </Step>

  <Step title="Create a capsule and run a command">
    Use `Capsule` as a context manager. When the `with` block exits, the capsule is automatically destroyed.

    ```python theme={null}
    from wrenn import Capsule

    with Capsule(template="minimal", wait=True) as capsule:
        result = capsule.commands.run("echo hello")
        print(result.stdout)   # "hello\n"
        print(result.exit_code)  # 0
    ```

    `capsule.commands.run()` runs the command in the foreground and returns a result with `stdout`, `stderr`, `exit_code`, and `duration_ms`.
  </Step>

  <Step title="Try the code interpreter">
    For stateful Python execution backed by a persistent Jupyter kernel, use `wrenn.code_interpreter`:

    ```python theme={null}
    from wrenn.code_interpreter import Capsule

    with Capsule(wait=True) as capsule:
        result = capsule.run_code("print('hello')")
        print("".join(result.logs.stdout))  # "hello\n"
    ```

    Variables, imports, and function definitions persist across `run_code` calls within the same capsule session.
  </Step>
</Steps>
