I use a similar command, but with the following modifications.
apg -a 0 -m 30 -n 40 -x 30 -M SNCL -s -E O01l
  • -s is added to enforce the strict mode.
  • -E O01l is added to exclude the uppercase 'O', zero '0', the number one '1', and the lowercase 'l' to avoid confusion.