Shares of C3.ai (AI 3.29%) have soared over 20% since the company reported its fiscal fourth-quarter earnings on May 29. The enterprise artificial intelligence (AI) software company saw strong revenue growth and issued upbeat guidance. Despite the recent gains, the stock is still down over 30% over the past year.

Given the stock's recent gains, is it too late to buy the stock, or is the rebound in the stock just beginning?

Strong fiscal Q4 results and guidance

For its fiscal Q4, C3.ai saw its revenue rise 20% to $86.6 million. More importantly, subscription revenue climbed 41% to $79.9 million. Both total and subscription-revenue growth accelerated each quarter during the past fiscal year.

The company had Q4 gross margins of 59.6%, which is relatively low compared to many software companies, where they are often 75% or more. Its adjusted-gross margins, which take out stock-based compensation expenses, were around 70%. Subscription-gross margins, meanwhile, were only 56.4% for the quarter.

AI Gross Profit Margin Chart

AI Gross Profit Margin data by YCharts.

C3.ai is still not profitable, reporting adjusted earnings per share (EPS) of -$0.11. The company did manage to generate $18.8 million in free cash flow in the quarter, although free cash flow for the full year was -$90.4 million.

Looking ahead, C3.ai forecast fiscal Q1 revenue of between $84 million to $89 million, representing 16% to 23% growth. For the full fiscal year, it is projecting revenue in a range of $370 million to $395 million, representing growth of 18% to 27%.

The company is currently transitioning from a subscription, or software as a service (SaaS), model to a consumption-based model. It said this will lead to a much larger number of smaller transactions for a shorter term. It noted that it has received almost 50,000 inquiries from 3,000 businesses in Q4 and expects that to increase to 90,000 inquires in Q1.

While C3.ai's results and guidance were generally solid, it is worth noting that the company is spending a lot of money on sales and marketing to generate its revenue, with sales and marketing expense about 79% of revenue in the quarter. That's a nice improvement from a year ago, although it is still not the most efficient model, especially given its gross-margin profile. At the same time, a consumption model is less predictable than a subscription model.

Artist rendering of letter A and I in a cloud.

Image source: Getty Images.

Should investors buy the stock

C3.ai trades at a forward price-to-sales (P/S) ratio that is just over 9, which isn't out of line for a software company with 20% growth.

AI PS Ratio (Forward) Chart

AI PS Ratio (Forward) data by YCharts.

However, the company does carry lower gross margins than most software companies, and its move to a consumption-based model could make its results more lumpy. In addition, the company is very aggressive when it comes to stock-based compensation. In fact, its $215.8 million in stock compensation last year equated to 77.5% of the $278.1 million in revenue the company produced this past fiscal year.

While stock comp is non-cash, it is a real expense that dilutes shareholders over time. This can be seen with the increase in C3.ai's shares outstanding over the past several years.

AI Shares Outstanding Chart

AI Shares Outstanding data by YCharts.

Given C3.ai's valuation, aggressive stock compensation, high sales and marketing spending, margin profile, and shift to a consumption model, I'd stay on the sidelines with the stock for now. The accelerating growth is a good story, but that now looks priced into the stock given some of the other issues surrounding the stock.