Prerequisite: Please make sure have active CloudFlare account and you have added your WordPress Website to CloudFlare. Also, make sure you are using CloudFlare nameservers for your domain.
Step 01: Sign in to your CloudFlare account
Step 02: Make sure flexible SSL certificate is enabled under the “Crypto” tab for your selected website
Step 03: While you are already signed in to your CloudFlare account go to > My Profile > Scroll down to API Keys and locate Global API Key & copy the same key for further use inside your website.