Override api class

I’d like to override the \Grav\Common\Page\Medium\ImageMedium api class to change the url function so that images are served from Cloudinary. How would one go about this in a plugin?

As a starter, I’d check onMediaLocate event hook. But I guess you’d just have to debug what you get there :thinking: Not much info about it