---
sidebar:
  label: roboto.http.options
  order: 3
title: roboto.http.options
---
## Module Contents

### HttpClientOptions

```python
class roboto.http.options.HttpClientOptions
```

`from roboto.http import HttpClientOptions`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/http/options.py#L52-L56)

Behavior of a [`HttpClient`](/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient), applied to every request it makes.

**Attributes**

- **HttpClientOptions.logging** (`HttpLoggingOptions`)
- **HttpClientOptions.retry** (`HttpRetryOptions`)

### HttpLoggingOptions

```python
class roboto.http.options.HttpLoggingOptions
```

`from roboto.http import HttpLoggingOptions`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/http/options.py#L26-L32)

How a [`HttpClient`](/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient) renders requests into its logs.

**Attributes**

- **HttpLoggingOptions.scrub_headers** (`Sequence[str]`) = `()`: Header names, compared case-insensitively, whose values are replaced with `*` in every rendered form of a request the client produces. `Authorization` is always scrubbed, with or without an entry here.

### HttpRetryOptions

```python
class roboto.http.options.HttpRetryOptions
```

`from roboto.http import HttpRetryOptions`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/http/options.py#L36-L48)

Whether and how many times a [`HttpClient`](/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.HttpClient) retries a failed request.

**Attributes**

- **HttpRetryOptions.max_attempts** (`int`) = `10`: Total attempts per request, first try included. Values below 1 behave as 1: the first attempt always runs.
- **HttpRetryOptions.predicate** (`RetryPredicate | None`) = `None`: Called with the request and the exception a failed attempt raised; `True` means try again. `None` keeps the default, [`is_expected_to_be_transient()`](/reference/python-sdk/roboto/http/http_client#roboto.http.http_client.is_expected_to_be_transient), which retries failures expected to be transient: DNS resolution failures unconditionally; connection errors, timeouts, and retryable HTTP statuses according to the request's idempotency.

### RetryPredicate

```python
roboto.http.options.RetryPredicate
```

`from roboto.http import RetryPredicate`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/http/options.py#L12-L12)

Decides whether the exception warrants another attempt at the request.

### never_retry()

```python
def roboto.http.options.never_retry(
    _request: roboto.http.request.HttpRequest,
    _exc: BaseException,
) -> bool
```

`from roboto.http import never_retry`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/http/options.py#L16-L22)

Retry predicate giving every request exactly one attempt.

Use for calls whose side effect must not run twice and where the server offers no idempotency key: a retried delivery (a chat message, an email) lands as a duplicate.

**Parameters**

- **`_request`** (`roboto.http.request.HttpRequest`)
- **`_exc`** (`BaseException`)

**Returns**

- `bool`
