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

# Python SDK

> Manage Blaxel resources programmatically using our Python SDK.

Blaxel features a SDK in **Python**.  To install, follow the instructions below.

## Install

<CodeGroup>
  ```shell Python (pip) theme={null}

  pip install blaxel

  ```

  ```shell Python (uv) theme={null}

  uv pip install blaxel

  ```

  ```shell Python (uv add) theme={null}

  uv init && uv add blaxel

  ```
</CodeGroup>

## Prerequisites

To use this SDK, you need a [Blaxel account](https://app.blaxel.ai) and the following environment variables:

| Variable       | Description                |
| -------------- | -------------------------- |
| `BL_WORKSPACE` | Your Blaxel workspace name |
| `BL_API_KEY`   | Your Blaxel API key        |

You can create an API key from the [Blaxel console](https://app.blaxel.ai/profile/security). Your workspace name is visible in the URL when you log in to the console (e.g. `app.blaxel.ai/{workspace}`).

Set them as environment variables:

```bash theme={null}
export BL_WORKSPACE=my-workspace
export BL_API_KEY=my-api-key
```

Or add them to a `.env` file at the root of your project. For other authentication options, see [Variables and secrets](../Agents/Variables-and-secrets).

Alternatively, you can authenticate via the [Blaxel CLI](../cli-reference/introduction):

```bash theme={null}
bl login
```

When you deploy on Blaxel, authentication is handled automatically.

## Guides

<CardGroup>
  <Card title="Create sandboxes" icon="book" href="/Sandboxes/Overview">
    Use Blaxel SDK to create and connect to sandboxes and sandbox previews.
  </Card>

  <Card title="Interact with a sandbox" icon="book" href="/Sandboxes/Processes">
    Use Blaxel SDK to manage the filesystem, processes and logs of a sandbox.
  </Card>

  <Card title="Connect to MCP servers" icon="book" href="/Agents/Develop-an-agent-py#Connect-to-tools">
    Use Blaxel SDK to retrieve tools from a deployed MCP server.
  </Card>

  <Card title="Connect to model APIs" icon="book" href="/Agents/Develop-an-agent-py#Connect-to-a-model-API">
    Use Blaxel SDK to retrieve an LLM client when building agents.
  </Card>

  <Card title="Deploy your MCP server" icon="book" href="/Functions/Create-MCP-server">
    Use Blaxel SDK to create and host a custom MCP server.
  </Card>

  <Card title="Chain agents" icon="book" href="/Agents/Develop-an-agent-ts#Connect-to-another-agent-multi-agent-chaining">
    Use Blaxel SDK to chain calls to multiple agents.
  </Card>
</CardGroup>

## Complete SDK reference

Visit the GitHub page below for detailed documentation on the SDK's commands and classes.

<Card title="Python SDK" icon="python" href="https://github.com/blaxel-ai/sdk-python">
  Open the GitHub repository for Blaxel SDK in Python.
</Card>
