# Python Client

We provide a Python client library that you can use to interact with the API. You can find the library [here](https://github.com/gridstatus/gridstatusio).

#### Installation

`gridstatusio` supports Python 3.10+. Install with pip (or uv):

```
pip install gridstatusio
```

Upgrade using:

```
python -m pip install --upgrade gridstatusio
```

#### Authentication

You can authenticate using your API key in one of two ways:

1. **Set an environment variable**:

```
export GRIDSTATUS_API_KEY=your_api_key
```

2. **Pass the API key directly** when creating the client:

```
from gridstatusio import GridStatusClient

client = GridStatusClient(api_key="your_api_key")
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gridstatus.io/developers/getting-started/python-client.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
