Answer by taking a quote from the following article:

Jean-Philippe Rameau (French: [Zafilip Ramo]; (1683-09-25)25 September 1683 - (1764-09-12)12 September 1764) was one of the most important French composers and music theorists of the 18th century. He replaced Jean-Baptiste Lully as the dominant composer of French opera and is also considered the leading French composer for the harpsichord of his time, alongside Francois Couperin. Little is known about Rameau's early years, and it was not until the 1720s that he won fame as a major theorist of music with his Treatise on Harmony (1722) and also in the following years as a composer of masterpieces for the harpsichord, which circulated throughout Europe.

Unlike Lully, who collaborated with Philippe Quinault on almost all his operas, Rameau rarely worked with the same librettist twice. He was highly demanding and bad-tempered, unable to maintain longstanding partnerships with his librettists, with the exception of Louis de Cahusac, who collaborated with him on several operas, including Les fetes de l'Hymen et de l'Amour (1747), Zais (1748), Nais (1749), Zoroastre (1749; revised 1756), La naissance d'Osiris (1754), and Anacreon (the first of Rameau's operas by that name, 1754). He is also credited with writing the libretto of Rameau's final work, Les Boreades (c. 1763).  Many Rameau specialists have regretted that the collaboration with Houdar de la Motte never took place, and that the Samson project with Voltaire came to nothing because the librettists Rameau did work with were second-rate. He made his acquaintance of most of them at La Poupliniere's salon, at the Societe du Caveau, or at the house of the Comte de Livry, all meeting places for leading cultural figures of the day.  Not one of his librettists managed to produce a libretto on the same artistic level as Rameau's music: the plots were often overly complex or unconvincing. But this was standard for the genre, and is probably part of its charm. The versification, too, was mediocre, and Rameau often had to have the libretto modified and rewrite the music after the premiere because of the ensuing criticism. This is why we have two versions of Castor et Pollux (1737 and 1754) and three of Dardanus (1739, 1744, and 1760).

Was he commissioned to create these pieces ?