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

# Authentication

> Configure your API key

## Initialize the client

```python theme={null}
import os
from chatatp_studio import ChatATPClient

client = ChatATPClient(api_key=os.environ["CHATATP_API_KEY"])
```

## Options

| Parameter     | Type    | Default                | Description                           |
| ------------- | ------- | ---------------------- | ------------------------------------- |
| `api_key`     | `str`   | **required**           | Your Developer API key                |
| `base_url`    | `str`   | ChatATP production URL | Override for self-hosted environments |
| `timeout`     | `float` | `30.0`                 | Request timeout in seconds            |
| `max_retries` | `int`   | `2`                    | Retry attempts on transient failures  |
| `debug`       | `bool`  | `False`                | Log requests/responses                |

## Context manager

```python theme={null}
async with ChatATPClient(api_key="chatatp_sk_...") as client:
    result = await client.chat(
        agent_id=7,
        external_user_id="user_12345",
        message="Hello",
    )
```

## Debug logging

```python theme={null}
client = ChatATPClient(api_key="chatatp_sk_...", debug=True)
```

API keys are **never** logged, regardless of the `debug` setting.
