Emmanuel Quarless
08/17/2025, 1:12 PMMarvin
08/17/2025, 1:12 PMMarvin
08/17/2025, 1:14 PMfrom prefect.settings import get_current_settings
api_url = get_current_settings().api.url
print(api_url)
- Inside a running flow/task (runtime context):
from prefect.runtime import flow_run
print(flow_run.api_url)
- From the CLI:
prefect config view --show-defaults
Look for api.url
in the output.
- If you absolutely must use the environment:
echo $PREFECT_API_URL
But note this may be unset if your value comes from a Prefect profile.