California DMV says you need a M1 or M2 license to operate a Moped/Motorbike
If you got a DL all's ya got to do is take the written M/C test and then an instructor at the DMV will observe you operating your Motorbike to get your M2 or Motorcycle to get your M1
For the observation test I suggest you have a working tail/stop light and headlight on your M/B
Or if ya wanna take a 3 rd party Motorcycle class and learn how to ride a Motorcycle - they provide the M/C and usually 3 days and est cost of $250-$350
Upon completion and passing the M/C class the DMV will wave the observation test and ya just gotta take the written M/C test
to get your M1
But ya know what they say "it's only illegal if ya get caught"
Meh, I got a M1