HMP Birmingham prisoners Demehl Thomas and Moysha Shepherd admitted recording the video, in which they bragged about drug dealing and violent assaults on rival gang members.
Both admitted making a sound recording in jail, believed to be the first prosecution of its kind under the 1952 Prison Act.
They have been jailed for nine months.
Thomas, 25, formerly of Vernolds Croft in Highgate, and Shepherd, also 25, of Hampstead Road, Handsworth were sentenced at Birmingham Crown Court on Tuesday.
The pair made the video between 1 and 16 of August and then uploaded it to the internet.
Geraldine Toal, defending Shepherd, told the court that there was no reference to threats or intimidation in the video which was accepted by the judge.
Sentencing both men to nine-month sentences to begin after their existing jail terms, the judge told the pair what they had done was a "complete breach of prison rules".
The court heard Shepherd is serving a sentence of five years and 11 months for dangerous driving. Thomas is serving a seven-year sentence for aggravated burglary.
The Prison Act was intended to "minimise the potential" for a camera or recording device to be used inside prison, police have said.
Two inmates have pleaded guilty to making a "selfie" rap video using a mobile phone smuggled into a jail.