# Configuration (/docs/sdks/python/configuration)



## Overview [#overview]

Configuration is optional. The SDK's defaults are suitable for most integrations, so you only need this guide when you want fine-grained control over behavior such as retries, timeouts, and the underlying HTTP client.

```python
import httpx
from insion import InsionClient

client = InsionClient(
    token="<token>",
    timeout=30.0,
    max_retries=2,
    httpx_client=httpx.Client(),
)
```

<Callout type="warn">
  Keep the API key on a trusted server. Never expose it in client applications, logs, or source control.
</Callout>

The default timeout is 60 seconds and the default retry limit is two. A token may be a callable for rotating credentials. The optional `aiohttp` extra supports an `httpx-aiohttp` transport.

## Async client [#async-client]

```python
from insion import AsyncInsionClient

client = AsyncInsionClient(token="<token>")
result = await client.moderate_a_record(
    client_id="post-123", name="A post", entity="post", content="Hello",
)
```

Use `httpx.AsyncClient` when supplying `httpx_client` to the async client.

## Per-request options [#per-request-options]

Every method accepts `request_options` for one-off settings:

```python
client.list_records(
    limit=50,
    request_options={"timeout": 10, "max_retries": 0, "additional_headers": {"X-Request-ID": "req-123"}},
)
```
