How can I add Option Group for custom data field in CiviCRM
Are you trying to add these in an extension?  If so, see adding custom fields with civix which suggests creating them via the GUI then exporting them.