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

# Authentication

> Configure your Paubox API credentials for the Ruby SDK.

## Obtain your credentials

The Email API client requires two credentials:

* **API key**: a secret token that authenticates your requests
* **Username**: your Paubox API endpoint username (not your login email)

Both are available in the [Paubox dashboard](https://next.paubox.com) under **API Credentials**.

## Global configuration (recommended)

Set credentials once at application startup. All `Paubox::Client` instances will use them automatically:

```ruby theme={null}
require 'paubox'

Paubox.configure do |config|
  config.api_key  = ENV['PAUBOX_API_KEY']
  config.api_user = ENV['PAUBOX_API_USER']
end

client = Paubox::Client.new
```

## Per-client configuration

Override credentials for a specific client instance:

```ruby theme={null}
client = Paubox::Client.new(
  api_key:  'YOUR_API_KEY',
  api_user: 'YOUR_USERNAME'
)
```

The SDK sets the `Authorization` header automatically on every request:

```
Authorization: Token token=YOUR_API_KEY
```

## Forms client

`Paubox::FormsClient` requires no credentials:

```ruby theme={null}
forms_client = Paubox::FormsClient.new
```

## Security notes

* Never hard-code credentials in source files — always read from environment variables.
* The SDK does not log API keys or request bodies.
