Skip to content

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

Terminal window
curl --request POST \
--url https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1 \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: multipart/form-data' \
--form file=@./<YOUR_IMAGE.IMG>

Enable transformations on your zone

You can dynamically optimize images that are stored outside of Cloudflare Images and deliver them using transformation URLs.

Cloudflare will automatically cache every transformed image on our global network so that you store only the original image at your origin.

To enable transformations on your zone:

  1. Log in to the Cloudflare dashboard and select your account.
  2. Go to Images > Transformations.
  3. Go to the specific zone where you want to enable transformations.
  4. Select Enable for zone. This will allow you to optimize and deliver remote images.