# Client

```python
class Client(
    *,
    url: str = "https://api.tilebox.com",
    token: str | None = None,
    warn_if_unauthenticated: bool = True,
    transport: Literal["grpc", "http1"] = "grpc",
)
```

Create a Tilebox datasets client.

## Parameters

**url**

`str`

Tilebox API Url. Defaults to `https://api.tilebox.com`.

**token**

`str | None`

The API key to authenticate with. If not set, the `TILEBOX_API_KEY` environment variable is used.

**warn\_if\_unauthenticated**

`bool`

Whether to log a warning when no API key is provided for the Tilebox API URL. Defaults to `True`.

**transport**

`Literal["grpc", "http1"]`

Network transport to use for API requests. Defaults to `"grpc"`. Use `"http1"` to force the Connect protocol over HTTP/1.1 on networks that do not support gRPC over HTTP/2 correctly.

If no API key is provided, the client uses anonymous open data access for public datasets.

```python title="Python"
from tilebox.datasets import Client

# read token from an environment variable
client = Client()

# or provide connection details directly
client = Client(
    url="https://api.tilebox.com",
    token="YOUR_TILEBOX_API_KEY",
)
```
