The Pinkprint (Deluxe Version) album cover
The track was released December 15, 2014, on Nicki's third studio album "The Pinkprint". It was produced by Beyoncé and Hit-Boy.
I found some backgound information on Wikipedia here:
In May 2014, Minaj's manager Gee Roberson contacted her to inform her that Beyoncé wanted a remix of "Flawless" on which she would be featured. Following this, Beyoncé sent Minaj a new version of the song she wanted and told Minaj, "I want you to be you. I don't want you to hold back." Minaj agreed to do the song with her and in return Beyoncé would be featured on The Pinkprint. Singer-songwriter SZA was en-listed to co-write parts of the song. She was called and later went to the studio to meet and work with the song's producer, Hit-Boy. During the studio session SZA wrote the song's lyrics whilst Beyoncé and Hit-boy produced it.
The official video was released on TIDAL right here on May 18, 2015, where it was exclusive to subscribers, but it leaked to other platforms like Vimeo:
Get the lyrics on Genius
Playlist of all Tracks of the Day: http://spoti.fi/2DuGZ4s
Let me know about your favorite Rap tracks in the comments!