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

# Rate Limits Example

> Python code example for checking API rate limits and health status using the Swarms API.

## Overview

This example demonstrates how to check API rate limits and health status using the Swarms API client.

## Step 1: Installation

Install the required package:

```bash theme={null}
pip install swarms-client python-dotenv
```

## Step 2: API Key Setup

Set your API key in a `.env` file:

```bash theme={null}
SWARMS_API_KEY=your_api_key_here
```

## Step 3: Code Example

```python theme={null}
from swarms_client import SwarmsClient
from dotenv import load_dotenv
import os

load_dotenv()

client = SwarmsClient(api_key=os.getenv("SWARMS_API_KEY"))

response = client.client.rate.get_limits()
print(response)

print(client.health.check())
```

Run the script to check your current rate limits and API health status.
