OS X 10.8 and later. Apple Music stores the audio files it plays in ~/Library/Caches/com.apple.iTunes/SubscriptionPlayCache/. This script will simply delete that folder.
The files in this folder are specially protected audio files that are downloaded and cached when you play a track from Apple Music on your Mac. They can't be user-played and are only useful to Apple Music, ostensibly so iTunes doesn't have to re-download them if they are played again. (This cache folder doesn't pertain to Radio music. Or to Apple Music you've added to your library for offline listening, the files of which are stored in your "iTunes Media" folder.)
Be sure to also see View Cached Music, a free app that lists track information about the Apple Music files cached on your computer.
About 1GB per 100 files or so.
Perhaps Also of Interest...
downloaded 4m 54s ago
Displays files in iTunes Media folder not in iTunes track library
downloaded 15m 5s ago
Display a selected file's audio and Spotlight metadata
downloaded 44m 25s ago
Exports and then re-imports selected tracks' artwork
downloaded 1h 43m 14s ago
Export selected playlists as individual XML or M3U files
downloaded 1h 48m 23s ago
Sort purchased tracks into discrete playlists by name or Apple ID
downloaded 1h 49m 13s ago
Create a playlist of tracks that do not have lyrics text