> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.usebridge.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.usebridge.com/_mcp/server.

# Python

Bridge provides a Python client for interacting with the Bridge API. This SDK simplifies API integration by providing type-safe methods, automatic authentication handling, and built-in error handling.

## Features

* **Type Safety**: Full Python type hints with generated types from our API specification
* **Authentication**: Automatic token management and refresh handling
* **Error Handling**: Comprehensive error handling with detailed error messages
* **Request/Response Validation**: Built-in validation for all API requests and responses
* **Modern Python**: Async/await support with Pydantic models

## Installation

Install the SDK from PyPI:

```bash
pip install usebridge-api
```

## Quick Start

```python
from usebridge_api import BridgeApiClient, BridgeApiEnvironment

# Initialize the client
client = BridgeApiClient(
    api_key="your-api-key",
    environment=BridgeApiEnvironment.PRODUCTION,  # or BridgeApiEnvironment.SANDBOX (defaults to PRODUCTION if not specified)
)

# Create a Patient
patient = client.patients.v2.create_patient(
    first_name="Jane",
    last_name="Smith",
    email="patient@example.com",
    date_of_birth="2000-01-01",
)
```

## Resources

#### [PyPI Package](https://pypi.org/project/usebridge-api/)

#### [GitHub Repository](https://github.com/use-bridge/api-python)

#### [API Reference](/api)

#### [Testing Guide](/api/resources/testing)