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

# Create Preset

> Save a named transform with client.create_preset().

Saves a named transform. Apply it anywhere with `{"preset": key}` — and change it later
without touching the URLs that use it.

```python theme={null}
preset = client.create_preset(
    key="thumb",
    name="Thumbnail",
    transform={"width": 200, "height": 200, "fit": "cover", "format": "webp"},
)
```

## Signature

```python theme={null}
client.create_preset(*, key, name, transform, timeout=NOT_GIVEN) -> Preset
```

| Parameter | Type | Description |
| :- | :- | :- |
| `key` | `str` | **Required.** Lowercase letters, numbers and underscores only |
| `name` | `str` | **Required.** Human-readable label for the dashboard |
| `transform` | [`Transform`](https://docs.dreep.cloud/python-sdk/media/build-url#parameters) | **Required.** What the preset applies. Must include a `format` |

## Returns

```python theme={null}
preset.id      # "4c2a91e0-…" — what delete_preset() takes
preset.key     # "thumb"
preset.name    # "Thumbnail"
preset.params  # {"width": 200, "height": 200, "fit": "cover", "format": "webp"}
```

## Using it

```python theme={null}
client.url(asset, {"preset": "thumb"})
# …/fetch/2f928a3f-1d2a-4a2b?p=thumb

# On upload, instead of a transform
client.upload(Path("hero.jpg"), preset_key="thumb")
```

Change the preset later and every URL using it follows — which is the point of naming a
transform rather than repeating it.

> [!NOTE]
>
> A preset must include a `format`. Preset keys may only contain lowercase letters, digits
> and underscores, so `thumb_2x` is valid and `Thumb-2x` is not.

## Errors

| Error | Cause |
| :- | :- |
| `DreepValidationError` | Invalid key characters, a missing `format`, or a key already in use |
| `DreepLimitError` | The plan's preset limit is reached |
| `TypeError` | A misspelled transform key |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.