It's official. Tesla has returned its first profitable quarter after 10 years in the business, following promises that it would be in the black in 2013.

Tesla recorded sales of $562 million, a gain of over 80 percent from the last quarter, with 4,900 Model S sedans delivered. That's an 83 percent bump from Q4, with a total gross margin rise from 8 to 17 percent thanks to boosted Model S production and reducing the cost of parts. But all that cash isn't simply from sales and ironing out production kinks.

Tesla says in its investor letter that $7 million came from development services for the Mercedes-Benz B-Class Electric and Toyota RAV4 EV, while 12 percent of revenue – $68 million – came from selling zero emission vehicle (ZEV) credits to other automakers. Tesla expects that number to decline as the year wears on and assumes that a gross margin of 25 percent in Q4 will not include the ZEV credits.

Our back of the napkin math shows that there's a 5-6 percent gross margin on vehicles excluding the ZEV credits. Factor that ZEV cash in and you're close to 17 percent.

All in for Q1, Tesla netted $11 million in GAAP profit, with total cash increasing $10 million from the last quarter at $231 million – and that includes making its second quarterly repayment of nearly $13 million on its DOE loans.

Tesla expects to build 5,000 Model S sedans in Q2 and deliver 4,500 of those in North America. For the year, Tesla is projecting to exceed its 20,000 worldwide delivery target by 1,000 vehicles.

Tesla concedes that "there is a huge amount of work ahead to improve the gross margin of the Model S," and that's going to contribute to a projected lower gross margin in the high teens in Q2. Additionally, there's a lower average selling price with the start of deliveries of the lower-spec 60kWh Model S sedan, which will affect overall profits next quarter.

As for financing, Musk said during the announcement that half of purchases of the Model S have been through Tesla's own financing program, and 25 percent of shoppers plunk down a deposit for a Model S after a test drive.

Musk also quipped, "Apparel sales are going really well."