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

# Installation

### Step 1: Sign Up and Create an API Key

1. Visit [Chunkr AI](https://chunkr.ai)
2. Click on "Login" and create your account
3. Once logged in, navigate to "API Keys" in the dashboard

For self-hosted deployments:

* [Docker Compose Setup Guide](https://github.com/lumina-ai-inc/chunkr?tab=readme-ov-file#quick-start-with-docker-compose)
* [Kubernetes Setup Guide](https://github.com/lumina-ai-inc/chunkr/tree/main/kube)

### Step 2: Install our client SDK

<CodeGroup>
  ```python Python theme={"system"}
  pip install chunkr-ai
  ```
</CodeGroup>

### Step 3: Upload your document

<CodeGroup>
  ```python Python theme={"system"}
  from chunkr_ai import Chunkr

  # Initialize the Chunkr client with your API key - get this from https://chunkr.ai
  chunkr = Chunkr(api_key="your_api_key")

  # Upload a document via url or local file path
  url = "https://chunkr-web.s3.us-east-1.amazonaws.com/landing_page/input/science.pdf"
  task = chunkr.upload(url) 
  ```
</CodeGroup>

### Step 4: Clean up

You can clean up the open connections by calling the `close()` method on the `Chunkr` client.

<CodeGroup>
  ```python Python theme={"system"}
  chunkr.close()
  ```
</CodeGroup>

## Environment Setup

You can authenticate with the Chunkr AI API in two ways:

1. **Direct API Key** - Pass your API key directly when initializing the client
2. **Environment Variable** - Set `CHUNKR_API_KEY` in your `.env` file

You can also configure the API endpoint:

1. **Direct URL** - Pass your API URL when initializing the client
2. **Environment Variable** - Set `CHUNKR_URL` in your `.env` file

This is particularly useful if you're running a self-hosted version of Chunkr.

<CodeGroup>
  ```python Python theme={"system"}
  from chunkr_ai import Chunkr

  # Option 1: Initialize with API key directly
  chunkr = Chunkr(api_key="your_api_key")

  # Option 2: Initialize without api_key parameter - will use CHUNKR_API_KEY from environment
  chunkr = Chunkr()

  # Option 3: Configure custom API endpoint
  chunkr = Chunkr(api_key="your_api_key", chunkr_url="http://localhost:8000")

  # Option 4: Use environment variables for both API key and URL
  chunkr = Chunkr()  # will use CHUNKR_API_KEY and CHUNKR_URL from environment
  ```
</CodeGroup>
