code: public function execute()
      {
          $result = $this->resultJson->create();
  
          try {
              $activeVersion = $this->getRequest()->getParam('active_version');
              $ioOptions = $this->api->getImageOptimizationDefaultConfigOptions($activeVersion)->data->attributes;
  
              if (!$ioOptions) {
                  return $result->setData([
                      'status'    => false,
                      'msg'       => 'Failed to fetch image optimization default config options.'
                  ]);
              }
  
              return $result->setData([
                  'status'        => true,
                  'io_options'    => $ioOptions
              ]);
          } catch (\Exception $e) {
              return $result->setData([
                  'status'    => false,
                  'msg'       => $e->getMessage()
              ]);
          }
      }
docs: List all image optimization default config options
  
  @return $this|\Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface