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

# Google Colab setup

> Install EDSL and load credentials in a Colab notebook.

[Google Colab](https://colab.research.google.com) runs Python notebooks in a hosted environment. In a new notebook, install EDSL in a code cell:

```text theme={null}
%pip install edsl
```

Then follow the [Run your first survey](https://docs.expectedparrot.com/en/latest/starter_tutorial.md) tutorial. Its local test model needs no credentials. Re-run installation when you start a new runtime.

## Log in to Expected Parrot

To use Expected Parrot's model access, run this in a cell:

```python theme={null}
from edsl import login

login()
```

Follow the sign-in link in the output. EDSL retrieves your API key and configures the notebook session automatically. Run `login()` again when you start a new runtime. See [Notebook login](https://docs.expectedparrot.com/en/latest/api_keys.md#log-in-from-a-notebook) for options.

## Use Colab secrets as an alternative

If you already have an Expected Parrot API key, you can instead add `EXPECTED_PARROT_API_KEY` to Colab's Secrets panel and enable access for this notebook. Load it without displaying the value:

```python theme={null}
import os
from google.colab import userdata

os.environ["EXPECTED_PARROT_API_KEY"] = userdata.get("EXPECTED_PARROT_API_KEY")
```

For direct provider access, store and load the provider's environment variable instead. See [Model access](https://docs.expectedparrot.com/en/latest/api_keys.md) to choose the execution path. Do not paste keys into notebook cells or saved output.

## Preserve your work

The runtime's local files can disappear when the session ends. Save study packages and results to durable storage or download them before closing the runtime. [Sharing a Colab notebook](https://docs.expectedparrot.com/en/latest/colab_notebooks.md) explains how to save the notebook itself as supporting material.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.