from typing import Dict


def _get_apigw_stage(event: Dict) -> str:
    """Return API Gateway stage name."""
    header = event.get("headers", {})
    host = header.get("x-forwarded-host", header.get("host", ""))
    if ".execute-api." in host and ".amazonaws.com" in host:
        stage = event["requestContext"].get("stage", "")
        return stage
    return ""