***

title: merge_with_env
slug: /reference/python/agents/configuration/config-loader/merge-with-env
description: Merge configuration with environment variables matching a prefix.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Merge the config file with environment variables that match a prefix. Config
file values take precedence; environment variables fill in gaps.

## **Parameters**

<ParamField path="env_prefix" type="str" default="SWML_" toc={true}>
  Prefix for environment variables to consider. The prefix is stripped and the
  remainder is converted to a lowercase config key (e.g., `SWML_SSL_ENABLED`
  becomes `ssl_enabled`).
</ParamField>

## **Returns**

`dict[str, Any]` -- Merged configuration dictionary.

## **Example**

```python {4-5}
from signalwire.core.config_loader import ConfigLoader

loader = ConfigLoader(["config.json"])
merged = loader.merge_with_env()
merged_custom = loader.merge_with_env(env_prefix="MYAPP_")

print(merged)
```