Excitement surrounding artificial intelligence (AI) has helped power explosive gains for a select group of stocks in 2023. Within that category, Palantir Technologies (PLTR 0.60%) is up 137% year to date, and C3.ai (AI 0.17%) has soared 147% across the stretch.

Which of these high-risk, high-reward growth stocks is better positioned to deliver big wins for long-term investors? Read on for a look at the pros and cons of investing in each company right now and a determination of which is likely the better buy. 

Pros and cons for Palantir

Founded in 2003, Palantir has been an early mover in big-data, machine-learning, and AI technologies. The recent launch of the company's Artificial Intelligence Platform appears to be powering a new growth phase for the company, and the trend is spurring interest among investors.

For instance, Wedbush senior analyst Daniel Ives believes that Palantir is the gold standard among AI stocks and expects that the data-software company will continue to gain ground in the commercial market and maintain strong business relationships with government customers.

Revenue increased 13% year over year in the second quarter, and the company sees sales growth jumping to 16% in the current quarter, an uptick after several quarters of a downward trend. Even with the company continuing to invest in major growth initiatives, profitability is also heading in the right direction.

Across the first half of this year, Palantir has posted an adjusted free-cash-flow margin of 27%. Meanwhile, it recorded net income of $45 million on a net income margin of 4%, based on generally accepted accounting principles (GAAP).

The business has now been profitable on a GAAP basis for three consecutive quarters. Palantir also has a strong balance sheet to work with, closing out last quarter with cash and marketable securities of roughly $3 billion and zero debt.

PLTR PS Ratio (Forward) Chart

PLTR PS ratio (forward) data by YCharts; PS = price to sales.

While Palantir's business broadly seems to be heading in a promising direction, investors have to keep in mind that the company already has a growth-dependent valuation. Trading at roughly 64 times this year's expected earnings and 14 times expected sales, some strong performance is already priced into the stock.

Palantir's remaining performance obligations (RPOs), i.e., non-cancelable contracted revenue, also ticked up on a sequential basis to $968 million at the end of the second quarter, up from $936 million at the end of this year's first quarter. On the other hand, RPOs were still down significantly from the $1.2 billion at the close of the second quarter last year.

The company's current valuation profile comes with significant downside potential if growth falls short of expectations or otherwise proceeds at an uneven pace in the short term. 

Pros and cons for C3.ai

Founded in 2009, C3.ai is a software and consulting services company that has pivoted to take advantage of hot technology trends.

The company initially focused on categories including energy-emissions tracking and the Internet of Things (IoT), but it's now aiming to capitalize on growing demand for AI technologies and services. Reflecting the shift, the business changed its name from C3 IoT to C3.ai in 2019. 

Revenue rose roughly 11% year over year to reach $72.4 million in its recently reported fiscal first quarter, which ended July 31. While the business is primarily focused on the enterprise market, it has also been gaining ground in the public sector.

The company has recently landed and expanded AI software services contracts with the Department of Defense, helping to push bookings derived from government customers up 39% year over year in the fiscal first quarter. 

For the full-year period, management is estimating sales will come in between $295 million and $320 million. If the company were to hit the midpoint of its guidance range, sales would increase roughly 15% annually.

After posting just a 5.3% annual revenue increase in its last fiscal year, C3.ai's sales growth seems to be accelerating again. But the stock still looks risky.

AI PS Ratio (Forward) Chart

AI PS ratio (forward) data by YCharts.

While C3.ai had initially said that it would become profitable on an adjusted basis in this year's fourth quarter, it no longer expects this to be the case. The company's shift into profitability now appears to be further out.

With its sales growth and profitability trajectories looking somewhat speculative, C3.ai is a high-risk stock trading at roughly 10 times this year's expected sales. It's possible that the company will still be able to deliver wins for patient shareholders, but it could face pressures as it competes with other players in the enterprise AI space, including Palantir. 

Which stock is the better buy?

While C3.ai could potentially exceed the expectations that are baked into its valuation, I believe that Palantir is ultimately the better buy right now. The larger company has shifted into delivering consistent profits, and it appears to have stronger overall footing in AI and machine learning software services.

Both stocks have highly growth-dependent valuations and are high-risk, high-reward plays, but Palantir stands out as the smarter investment right now.