Get started
In this guide, you will get started with Cloudflare Images and make your first API request.
Prerequisites
Before you make your first API request, ensure that you have a Cloudflare Account ID and an API token.
Refer to Find zone and account IDs for help locating your Account ID and Create an API token to learn how to create an access your API token.
Make your first API request
curl --request POST \ --url https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1 \ --header 'Authorization: <API_TOKEN> \ --header 'Content-Type: multipart/form-data' \ --form file=@./<YOUR_IMAGE.IMG>
Enable transformations
Transformations let you optimize images that are stored outside of Cloudflare Images. Cloudflare will automatically cache every transformed image on our global network so that you store only the original image at your origin.
To use transformations, you’ll need to enable this feature on each zone:
- Log in to the Cloudflare dashboard and select your account.
- Go to Images > Transformations.
- Select the zone where you want to enable transformations.
- Select Enable.
- To transform images only from the enabled zone, uncheck Resize images from any origin. This will prevent third parties from resizing images at any origin.