The invention provides a process for the N-demethylation or the N- and O-demethylation of a thebaine derivative which process comprises fermenting the derivative with a biocatalyst selected from the filamentous fungi fromCunninghamella dalmatica NRRL 1394,Cunninghamella echinulata NRRL 1387,Cunninghamella echinulata NRRL 1384,Cunninghamella echinulata ATCC 36190,Cunninghamella echinulata ATCC 11585a, Cunninghamella echinulata ATCC 9244,Cunninghamella polymorpha NRRL 1395, orRhizopus nigricans Z5/1in a basal fermentation medium at a temperature of at least 25° C. and not more than 34° C., for a period of time of at least 3 days.