Lieut. Arex said:
Yes. I think it's Kirk though. When they're storming Kor's HQ, he says something about Star Fleet getting a return on their considerable investment in them. There's a similar comment in "The Apple" after Spock get's the chest full of poison thorns. Kirk asks him if he knows how much Star Fleet has spent on his training and Spock starts to quote the figure.
To the broader issue, there's always going to be confusion on this issue when people try to view the original series through the socialist utopian lens of TNG.
In Star Trek, the Federation, if not outrightly a capitalist society, retained many of the characteristics of one. Officers were paid credits for their work. Miners dug dilithium and pergium for credits. Asteroids were prospected and tribbles bought and sold for credits. Subspace radio brides were provided for credits and false patents were sold for them. Mad starship captains planned to sell immortality for credits. Colloquial speech carries references to money or a medium of exchange--"Credits to navy beans", "I'd pay real money if he'd shut up".
It can be problematic to use the 24th century shows to illuminate the 23rd. They're either different universes (divergent WW3's, etc.) or something happened to change UFP culture and the mindset of humanity in the time between ST and TNG. Or rather Star Fleet culture as that's our limited window on the UFP. Drawing from GR's speculations in the TMP novelization, perhaps the 24th century attitudes are the result of nearly a century of the New Human movement's influence on Terran society.
Guinan may give you a drink for free, but if you want one on K7, better have a credit or two.