Robin: Why, thank you, Raven. I...I... Wait, was that sarcasm?
Gratitude is one of the moral values cherished by many characters, but some characters don't really feel the same way and would let others know it. Then there are some characters who do indeed show gratitude, but only in a very special way.
When being outright ungrateful doesn't cut it, putting some sarcasm to your gratitude will. Let's say Alice does something nice for Bob like giving him a present. Being the Deadpan Snarker he is, and seeing that the gift isn't what he expected, Bob thanks Alice for putting little effort in making the gift. If Alice is Sarcasm-Blind, she'll accept Bob's "gratitude". If she sees right through it, she will call him out on it. Then if Alice knows that Bob won't like the gift, and made it for the sole intention of annoying him, then Bob's gratitude is a retort, showing that the two are Vitriolic Best Buds anyways.
This can be also used as a response to a character who gives out information in the most condescending way or information that is obvious for the character to know. Also, this can used by a character, particularly a The Lancer or a Sarcastic Devotee, who responds to a hero's actions that had worsen the situation, usually just to show contempt for the hero they always have for him to begin with.
A character can also use this trope as a threat more than just a snark. A hero rescues an enemy or rival from their death. Instead of being ungrateful, the enemy/rival thanks the hero for saving him...just so they can kill him. If it's the hero who's doing the thanking, then it'll be him thanking the villain for putting him through hell just to come back stronger and give him the ass-kicking he deserves. However this trope is used, this is one unique way to show how characters don't have to be ungrateful and can thank others while spiting them at the same time.
See also Backhanded Apology, Flippant Forgiveness, and Stealth Insult. If the gratitude is grudging than sarcastic, then it's Grudging "Thank You". Compare Sarcastic Clapping. Truth in Television, but let's not go there.
- Commercials for Hotels.com have an unpleasant situation set up followed by a man in a captain's uniform entering and commenting on it. The response is usually "Thanks, Captain Obvious." in a snarky tone.
- Ice Age 4: Continental Drift has Shira do this with Diego after the latter retrieves a bowl of water for her. He then proceeds to lampshade it.
Diego: You have this way of making "thank you" sound like "drop dead".
- Cobra has Internal Affairs Detective Monte, who is constantly insulting and berating the titular Cowboy Cop because he sees his brand of justice as utterly unnecessary. His last line of the film, even after finding out the hard way that the Serial Killer "the Night Slasher" had an entire army of fanatical followers, one of which was The Mole within the LAPD, which Cobra killed almost single-handedly, is to sneer about how he would have found a more "subtle" way of dealing with the aforementioned fanatical cultist army after saying that Cobretti did some good work today.
- In The Quiet Man, when Sean Thornton and his loutish bully of a brother-in-law finally have the fight the entire county has been anticipating ever since the two first crossed paths, everyone around wants to witness it and/or keep it going. So every time one of the fighters gets knocked down or looks to be unable to continue, a bucket of water is tossed on them to revive them and keep the fight going. It's a Running Gag that Thornton is fine and about to get up on his own every time the overly enthusiastic crowd douses him, causing him to take a second to get over the shock of the cold water and mutter a sarcastic "Thanks" before he gets back to fighting.
- In Memory Ivan sarcastically thanks Miles for drafting him as an assistant. But the snark drops away at once when Miles explains that they're going to be investigating ImpSec's handling of Simon Illyan's breakdown.
Ivan: He wanted a donkey to carry his luggage, and the first ass he thought of was me.
- One episode of Farscape (when Scorpius was a prisoner on Moya) saw the ship get taken over by pirates. Crichton discovers that Scorpius has also escaped his cell and hatches a plan to retake the ship. This involves handing him a large blaster and staging an ambush. When they actually pull off the ambush, Scorpius tries to fire on the enemy and discovers Crichton gave him an uncharged blaster. His response: "Thank you, John."
- In the backstory of Firefly, a civil war was fought among the various human planets about whether to unite under one government or not. Two of the main characters, Mal and Zoe, fought on the side of the Independents, who lost. In episode "The Train Job", Mal and Zoe are at a bar during "Unification Day", which celebrates the victory of the Alliance over the Independents. A rowdy and drunk pro-Alliance customer notices Mal's brown coat, a distinctive article of clothing worn by the Independents, and picks a fight with Mal. It turns out that guy isn't the only drunk and patriotic Alliance guy there, and Mal and Zoe wind up in a fight with the entire bar. After they've been pushed back to the edge of a nearby cliff and are still facing numerous angry brawlers, they have this exchange.
Mal: Whoa! There's just an acre of you fellas, ain't there? [to Zoe] This is why we lost [the war], you know. Superior numbers.
Zoe: [very sarcastically] Thanks for the reenactment, sir.
- In Law & Order: Special Victims Unit, one episode has Captain Cragen meet a professor who it turns out he previously arrested for a serious crime when he was still a detective, and immediately suspects him of murdering the victim (who was in a relationship with him). Long story short, he ends up arresting him and destroying his career before realizing he's innocent. He apologizes and assures him he'll capture the real killer, earning a very bitter "My hero".
- Star Trek: The Original Series: In "The Immunity Syndrome'', Spock takes a shuttlecraft inside the giant space amoeba, but falls out of contact. When the Enterprise is leaving the amoeba after planting a bomb, it passes by the shuttlecraft and Captain Kirk decides to use a Tractor Beam to save Spock. When Spock protests, Dr. McCoy says "Shut up, Spock! We're rescuing you!". Spock replies "Why thank you, Captain McCoy".
- In the November 26th, 2007 edition of WWE Raw, Mr. McMahon announced an ultimatum for Ric Flair, stating that if he loses a match, he retires from wrestling. Then-WWE Champion Randy Orton comes out to show his respects to Flair, thanking him for what he's done to his career and the industry, and finally thanks him for giving him the honor and pleasure to end his career.
- Jeff Foxworthy has a story about running into a daddy longlegs (which is sorta related to spiders). He decides to do the humane thing and take it outside to release it, but accidentally breaks six of its legs.
Daddy Longlegs: Thanks for the help, buddy. I'm an octoplegic now, thank you very much.
- In Life Is Strange: Before the Storm, if the player chooses to have Chloe thank David for giving her a lift to school, he'll assume it was this if she backtalked him instead of listening to his lecture in the car on the way.
- In one of the Riddler side missions of Batman: Arkham Knight, Catwoman asks the titular character what is Riddler's problem in giving them yet another puzzle. Batman, being The Comically Serious, replies with "fanatic narcissism, egocentrism and megalomania crossed with severe obsessive compulsion." Being the Deadpan Snarker she is, Catwoman sarcastically thanks him for the information.
- Wipeout Roblox: When a chat bubble glitch happens in "Banana Splits" Rman sarcastically says "Thank you Roblox."
- SpongeBob SquarePants: In "New Student Starfish", Patrick gets SpongeBob in trouble in school as he wrote an ugly picture of Mrs. Puff. Mrs. Puff thinks SpongeBob drew it and removes one of SpongeBob's stars. After Mrs. Puff orders him to sit at the back of the classroom, SpongeBob sarcastically thanks Patrick, who replies with "Sure thing, buddy."
- Teen Titans Go!: In the episode "Thanksgetting", Raven tells Robin (as seen in the quote above) that she's grateful to have a great friend like Robin. Robin is touched by her words until he realizes she was being sarcastic. This doesn't help that Raven and the other Titans (except Robin) are not excited about Thanksgiving.
- Jimmy Neutron: Boy Genius features an episode in which the titular character enters an alternate dimension where everyone has a doppelganger. The catch? Everyone in this alternate dimension is evil. Evil is the norm and is expected of every resident. Jimmy disguises himself to look like his evil counterpart before entering The Candy Bar to discover his whereabouts. At the end of the insult-laden conversation with the icecream vendor, he remarks "Thanks for nothin' ya gelatinous waste of space!"