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 11m 14s ago
Convert or import tracks with any encoder on the fly
downloaded 35m 46s ago
Remove iTunes tracks disassociated from files
downloaded 44m 10s ago
Display, create text file listing info of dead tracks
downloaded 2h 26m 3s ago
Display/export a text file list of chosen tag data in library or playlist
downloaded 2h 35m 50s ago
Use tag data to formulate new file name for selected tracks' files
downloaded 2h 37m 15s ago
Emulates iTunes search and copies results to a playlist