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

# Installation

> Install and set up the Claro Python SDK

# Python SDK Installation

The Claro Python SDK is available on PyPI and supports Python 3.8 and higher.

## Requirements

* Python 3.8 or higher
* pip (Python package installer)
* A Claro API key ([get one here](https://claro.baytos.ai))

## Install via pip

Install the latest stable version:

```bash theme={null}
pip install baytos-claro
```

### Verify Installation

```bash theme={null}
python -c "import baytos.claro; print(claro.__version__)"
```

## Virtual Environment (Recommended)

We recommend using a virtual environment to isolate your project dependencies:

<Tabs>
  <Tab title="uv">
    ```bash theme={null}
    # Create virtual environment with uv (fastest)
    uv venv

    # Activate it
    source .venv/bin/activate  # On macOS/Linux
    # or
    .venv\Scripts\activate  # On Windows

    # Install Claro
    uv pip install baytos-claro
    ```
  </Tab>

  <Tab title="venv">
    ```bash theme={null}
    # Create virtual environment
    python -m venv venv

    # Activate it
    source venv/bin/activate  # On macOS/Linux
    # or
    venv\Scripts\activate  # On Windows

    # Install Claro
    pip install baytos-claro
    ```
  </Tab>

  <Tab title="conda">
    ```bash theme={null}
    # Create conda environment
    conda create -n myproject python=3.11

    # Activate it
    conda activate myproject

    # Install Claro
    pip install baytos-claro
    ```
  </Tab>

  <Tab title="Poetry">
    ```bash theme={null}
    # Add Claro to your project
    poetry add claro

    # Install dependencies
    poetry install
    ```
  </Tab>
</Tabs>

## Install from Source

To install the latest development version:

```bash theme={null}
pip install git+https://github.com/baytos-ai/claro-python.git
```

<Warning>
  Development versions may contain unstable features. Use stable releases for production.
</Warning>

## Upgrading

To upgrade to the latest version:

```bash theme={null}
pip install --upgrade claro
```

Check your current version:

```bash theme={null}
pip show claro
```

## Dependencies

The SDK has minimal dependencies:

* `requests` - HTTP client for API calls
* `pydantic` - Data validation and settings management
* `typing-extensions` - Type hints for older Python versions

All dependencies are automatically installed with the SDK.

## Platform Support

The Claro SDK is tested on:

* **Operating Systems:** Linux, macOS, Windows
* **Python Versions:** 3.8, 3.9, 3.10, 3.11, 3.12
* **Architectures:** x86\_64, ARM64

## Configuration

After installation, configure your API key:

```bash theme={null}
export BAYT_API_KEY="your_api_key_here"
```

Or use a `.env` file:

```bash .env theme={null}
BAYT_API_KEY=your_api_key_here
```

<Note>
  See [Authentication](/authentication) for detailed setup instructions and best practices.
</Note>

## Troubleshooting

<AccordionGroup>
  <Accordion title="pip: command not found" icon="terminal">
    Install pip using your system's package manager:

    ```bash theme={null}
    # macOS
    brew install python3

    # Ubuntu/Debian
    sudo apt-get install python3-pip

    # Windows: Download from python.org
    ```
  </Accordion>

  <Accordion title="Permission denied when installing" icon="lock">
    Use `--user` flag to install without sudo:

    ```bash theme={null}
    pip install --user claro
    ```

    Or use a virtual environment (recommended).
  </Accordion>

  <Accordion title="ImportError after installation" icon="triangle-exclamation">
    Ensure you're using the correct Python interpreter:

    ```bash theme={null}
    # Check which Python you're using
    which python
    python --version

    # Try using python3 explicitly
    python3 -m pip install baytos-claro
    python3 -c "import baytos.claro; print(claro.__version__)"
    ```
  </Accordion>

  <Accordion title="SSL Certificate Error" icon="shield">
    Update your SSL certificates:

    ```bash theme={null}
    pip install --upgrade certifi
    ```

    Or install with trusted host flag:

    ```bash theme={null}
    pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org claro
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/sdk/python/quickstart">
    Make your first API call with the SDK
  </Card>

  <Card title="Client Configuration" icon="gear" href="/sdk/python/client">
    Configure timeouts, retries, and connection pooling
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Set up API keys and secure authentication
  </Card>

  <Card title="Examples" icon="code" href="/examples/basic-usage">
    Browse production-ready code examples
  </Card>
</CardGroup>
