Bavli Sanhedrin 67a states:
A SORCERER, IF HE ACTUALLY PERFORMS MAGIC, IS LIABLE [TO DEATH]. BUT NOT IF HE MERELY CREATES ILLUSIONS. R. AKIBA SAID IN R. JOSHUA'S NAME: OF TWO WHO GATHER CUCUMBERS [BY MAGIC] ONE MAY BE PUNISHED AND THE OTHER EXEMPT: HE WHO REALLY GATHERS THEM IS PUNISHED: WHILST HE WHO PRODUCES AN ILLUSION IS EXEMPT.
Sanhedrin 67b further clarifies:
Abaye said: The laws of sorcerers are like those of the Sabbath: certain actions are punished by stoning, some are exempt from punishment, yet forbidden, whilst others are entirely permitted. Thus: if one actually performs magic, he is stoned; if he merely creates an illusion, he is exempt, yet it is forbidden; whilst what is entirely permitted? — Such as was performed by R. Hanina and R. Oshaia, who spent every Sabbath eve in studying the Laws of Creation, by means of which they created a third-grown calf and ate it.
Footnote: It thus all depends as to whose help is invoked in performing the miraculous.