> ## 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

```typescript theme={null}
import { ChatATPClient } from "@chatatp/studio";

const client = new ChatATPClient({
  apiKey: process.env.CHATATP_API_KEY!,
});
```

## Options

| Option       | Type      | Default                | Description                           |
| ------------ | --------- | ---------------------- | ------------------------------------- |
| `apiKey`     | `string`  | **required**           | Your Developer API key                |
| `baseUrl`    | `string`  | ChatATP production URL | Override for self-hosted environments |
| `timeout`    | `number`  | `30000`                | Request timeout in milliseconds       |
| `maxRetries` | `number`  | `2`                    | Retry attempts on transient failures  |
| `debug`      | `boolean` | `false`                | Log requests/responses to console     |

## Debug logging

```typescript theme={null}
const client = new ChatATPClient({
  apiKey: process.env.CHATATP_API_KEY!,
  debug: true, // logs to console.debug
});
```

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

## Custom base URL

```typescript theme={null}
const client = new ChatATPClient({
  apiKey: "chatatp_sk_...",
  baseUrl: "https://your-self-hosted-instance.example.com",
});
```
