def METHOD_NAME(api_token: str, ttl_hash: Optional[int] = None) -> dict:
    """Get the CDN endpoint from the DigitalOcean API."""
    log.debug("Getting all CDN endpoints from the DigitalOcean API")
    headers = {"Authorization": f"Bearer {api_token}", "Content-Type": "application/json"}
    endpoints = {}
    next_uri = "https://api.digitalocean.com/v2/cdn/endpoints?per_page=200"
    while True:
        response = requests.get(next_uri, headers=headers)
        if response.status_code != 200:
            raise RuntimeError(f"failed to get CDN endpoint: {response.text}")
        data = response.json()
        if "endpoints" not in data:
            raise ValueError(f"no CDN endpoint in response: {response.text}")
        for endpoint in data["endpoints"]:
            endpoints[endpoint["origin"]] = endpoint["id"]
        if data.get("links", {}).get("pages", {}).get("next", None) is None:
            break
        next_uri = data["links"]["pages"]["next"]
    return endpoints