Apple (AAPL 2.00%) investors have been cheering lately as the iPhone maker's stock soared from roughly $197 on June 7 to more than $220 on June 12. It has retreated since, closing Tuesday at just over $214 a share -- but one Wall Street analyst now says it's a buy.

On Friday, Germany's Erste Group Bank upgraded Apple stock from neutral to buy. 

Is Apple stock a buy?

As StreetInsider reports, Erste analyst Hans Engel thinks the company's popularity with teens, and their intense loyalty to the brand -- with 90% of U.S. teenagers preferring iPhones to the alternatives -- are competitive advantages for Apple. The analyst also likes the tech titan's record of innovation, developing feature-rich, high-end devices and ever-faster chips for its Mac computers to keep its customers coming back for more.

In this regard, Engel sees Apple's move to integrate ChatGPT's artificial intelligence into the iPhone as a key development that "will lead to rising software and hardware sales" for the company.

Here's another reason to like the news: According to a Bloomberg report out last week, the total cost to Apple of adding ChatGPT to its iPhones is zero dollars, zero cents.

Neither Apple nor OpenAI have commented publicly on the financial terms of their partnership. But citing "people briefed on the matter," Bloomberg reported that Apple isn't paying OpenAI for ChatGPT. Instead, Apple has convinced OpenAI that "pushing OpenAI's brand and technology to hundreds of millions of its devices is of equal or greater value than monetary payments."

For OpenAI this seems like bad news: No big cash influx from Apple will be forthcoming. If it wants to make money, it will have to do so by convincing iPhone users to upgrade to paid versions of ChatGPT. Meanwhile, Apple gets access to the world's leading AI system for free.

That said, Apple stock at 33 times trailing earnings still isn't cheap. It will need to transform free ChatGPT into stronger earnings growth to justify this price. Until that happens, I cannot agree with Erste that Apple stock is a buy.