US tech giants saw their shares fluctuate this week as investors tried to gauge whether artificial intelligence will fill coffers or drain them.

While it is important to stay on the cutting edge by investing in AI, the market wants financial engines of tech firms going strong to pay for it, according to analysts.

Apple and Amazon on Thursday were the latest titans to see quarterly earnings scrutinized over how their core businesses are doing and whether cloud and AI strategies are paying off.

Amazon said its profit in the recently ended quarter doubled with the help of renewed momentum of its AWS cloud computing business.

Revenue at the AWS cloud computing unit grew, but the e-commerce giant's sales of $148 billion fell just shy of lofty market expectations, and shares dove in after-market trades.

Money taken in by Amazon ads was also shy of expectations.

Retail, ads and cloud computing are considered Amazon's financial pillars.

"While Amazon has multiple levers it can pull, the outlook is becoming tighter," said GlobalData Retail managing director Neil Saunders.

"Amazon will remain very profitable but the pace at which it can add to the bottom line appears to be waning," he said.

Amazon -- like other tech giants investing in AI -- is also spending more money, a factor investors are watching keenly.

"We remain very bullish on the medium to long term impact of AI in every business we know and can imagine," Amazon chief executive Andy Jassy said on an earnings call.

"Generative AI especially is quite iterative and companies have to build muscle around the best way to solve actual customer problems," Jassy said.

- Apple Intelligence -

Apple's quarterly profit rose from a year ago, the company said, besting analyst forecasts and giving its shares a boost in after-hours trading.

Money taken in by Apple's services unit from digital goods and subscriptions hit an all-time high, while the iPhone maker set a new revenue record overall for the June quarter, according to chief executive Tim Cook.

Cook played up the pending public launch of Apple Intelligence -- referring to its suite of AI features.

"Apple Intelligence builds on years of innovation and investment in AI and machine learning," Cook said on an earnings call.

"It will transform how users interact with technology," he added.

Apple has been under pressure to win over doubters on its artificial intelligence strategy after Microsoft and Google rolled out products in swift succession.

"For better or worse, Apple has married its AI efforts to other key parts of its core business, particularly the iPhone," said Emarketer analyst Jacob Bourne.

He added that the effectiveness of its AI investments will likely be measure by sales of Apple hardware and services.

- Seize the moment -

Meta on Wednesday reported profit that beat market expectations and caused its share price to jump.

The impressive profit came even though Meta's Reality Labs unit, devoted to virtual and augmented reality products, lost $4.5 billion, which was more than analysts expected.

"We are in the fortunate position where the strong results that we're seeing in our core products and business give us the opportunity to make deep investments for the future," Meta founder and chief Mark Zuckerberg said on an earnings call.

"I plan to fully seize that opportunity."

- Microsoft and Google -

Microsoft saw its shares slip this week on earnings figures showing its crucial cloud computing unit did not grow as strongly as expected.

Shares of Google parent Alphabet dropped on concerns that ad revenue was slowing while costs were on the rise after its earnings release.

"Meta stands out from other tech firms that have AI ambitions because it already brings in a massive amount of revenue from digital advertising," said Sonata Insights founder and chief analyst Debra Aho Williamson.

"Unlike Google, which is grappling with making changes that will impact its core ad business, most of Meta's AI investments are either aimed at making advertising on its properties work better, or at building new features that could eventually become revenue drivers."

gc/bjt