The people of the ancient Roman Empire, who spoke Latin, expressed the concept of "thank you" in multiple ways. A formal thank you was commonly said as gratias tibi ago. A less formal thank-you was simply benigne.
'Thank You' in Latin
Gratias tibi ago literally means "Thanks to you I give." The singular of gratias is gratia, which means "gratitude, esteem, obligation." So it makes sense that the plural would mean "thanks."
If you were thanking more than one person ("thanks to you all I give"), you would change the singular indirect pronoun tibi to the plural vobis, like this: Gratias vobis ago.
If more than one person is thanking someone, the singular verb ago ("I give") becomes the plural agimus ("we give"): Gratias tibi/vobis agimus.
The Grammar Behind the Phrase
Using the idiom gratias ago or some equivalent was the typical way that Latin speakers formally thanked each other.
Notice that both forms of "you" are in the dative case because this pronoun is the indirect object of the verb ago. Tu is the dative singular form, while the dative plural form is vobis. The verb ago is in the first-person singular present active indicative form. Agimus is the first-person plural. Latin didn't typically use the subject pronoun, thus we don't spell out the first-person singular nominative pronoun ego or the first-person plural nos. Gratias is in the accusative (direct object of ago) plural form of gratia, a first-declension feminine noun.
Latin sentences typically follow the subject-object-verb word order, but this can change depending on what the speaker wants to emphasize, with the stressed word coming first. For instance, the usual "I give thanks to you" would employ the standard gratias tibi ago order. To emphasize the person being thanked, use tibi/vobis gratias ago. To emphasize the person giving the thanks, use ago gratias tibi/vobis.
Thank you very much.
Gratias maximas (tibi ago). / Gratias ago tibi valde.
Thanks be to God.
Thank you for something.
The preferred way to express this is to use the preposition pro with the noun (ablative case) referring to what you're thanking someone for. Instead of pro, use propter with the noun as a gerund in the accusative case for a less idiomatic version. Form the gerund by adding -ndum to the stem.
"I want to thank you for your kindness."
Gratias tibi propter misericordiam volo.
"We thank you for good friends."
Tibi gratias agimus pro amicitia.
"I thank you for food."
Tibi gratias ago pro cibo.
"Thank you for the gift."
Tibi gratias ago pro dono.
Thank someone for something they did: After pro, use a gerund in the ablative case.
"Thank you for saving me."
Tibi gratias ago pro me servando.
Less Formal Latin for Thank You
There are other ways of thanking that are less formal and seem more like the modern English "thanks" or its equivalents in Romance languages, such as the French merci.
To say "thanks" or "no, thanks," just use the adverb benigne ("generously, kindly"). Whether it's an acceptance or a polite rejection depends on how you express it. For example:
Thank you! (Roughly "How generous of you" or "How kind of you")
"Nice of you to come."
"Nice of you to say so," which is an appropriate way to accept a compliment.