> ## Documentation Index
> Fetch the complete documentation index at: https://magicads.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare R2 Storage Integration

> Offload your media inputs and results to Cloudflare R2 Cloud Storage

## Introduction

Davinci AI’s allows you to integrate cloud storages to store results of various media related features of the script. This allows you to make sure that you always have sufficent storage space for your customers.
Using cloud storage option also minimizes the latency for your user to access their media results as data could be avaiable via CDN framework of the cloud vendors.

## Connect Cloudflare Account

To be able to use your Cloudflare account, follow these steps to setup integration.

<Steps>
  <Step title="Step 1">
    If you don’t have a Cloudflare account, [sign up here](https://www.cloudflare.com/)
  </Step>

  <Step title="Step 2">
    Once you are logged into your Cloudflare Account, Select **CloudFlare R2** from the side menu and click **Create Bucket** button

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-1.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=fa97cda1d4b8c650d2521a37906152ea" width="1607" height="750" data-path="images/storage/r2/r2-1.png" />
  </Step>

  <Step title="Step 3">
    Specify bucket name as needed and click **Create Bucket**.

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-2.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=f4012a2329744ce5ec0e314ba7e9fe7e" width="1076" height="690" data-path="images/storage/r2/r2-2.png" />
  </Step>

  <Step title="Step 4">
    After your bucket is created, click on the **Manage R2 API Toneks** link.

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-3.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=0d2bee23fc09385d337ab3ffed05cce6" width="1323" height="424" data-path="images/storage/r2/r2-3.png" />
  </Step>

  <Step title="Step 5">
    It will redirect you to your API Tokens page and click on **Create API Token** button.

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-4.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=1b24726749f19e57d89576f2d4c3ba1f" width="1333" height="297" data-path="images/storage/r2/r2-4.png" />
  </Step>

  <Step title="Step 6">
    Provide Token name as needed, in Permission section select **Object Read & Write** and specify if you want this token to be valid of a specific bucket or all your buckets afterwards click on **Create API Token** button.

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-5.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=61466d430098b55ca3eafe079540ee83" width="1192" height="1208" data-path="images/storage/r2/r2-5.png" />
  </Step>

  <Step title="Step 7">
    In the next page copy your **Access Keys ID**, **Secret Access Key** and your **Endpoint URL** and click finish button.

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-6.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=df4f108cb7ac61efdddf0419d4d2df9a" width="1186" height="1107" data-path="images/storage/r2/r2-6.png" />
  </Step>

  <Step title="Step 8">
    You will also need to get your **Public URL**, select your bucket and click on **Settings** tab

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-7.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=20731a41887b0c98918c173f653acca2" width="421" height="296" data-path="images/storage/r2/r2-7.png" />
  </Step>

  <Step title="Step 9">
    You have 2 options to get your public url, choose either one that you prefer **Custom Domain** (Requires further configuration, fully up to you to configure) or **Public R2.dev Bucket URL** (You need to set Allow Access and simply copy) q

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-8.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=824a7db6ccd6b4a6f1ecd05ea78f7543" width="1200" height="583" data-path="images/storage/r2/r2-8.png" />
  </Step>

  <Step title="Step 10">
    Login to Davinci AI using your admin credentials.
  </Step>

  <Step title="Step 11">
    In **Admin Panel**, navigate to **AI Settings** -> **AI API Keys** tab.
  </Step>

  <Step title="Step 12">
    Click on **Cloudflare** tab there.

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-9.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=2250f6dbd3c144e1f3307e0f0380854f" width="542" height="107" data-path="images/storage/r2/r2-9.png" />
  </Step>

  <Step title="Step 10">
    Fill in following required input field:

    * **Cloudflare R2 Access Key**
    * **Cloudflare R2 Secret Access Key**
    * **Cloudflare R2 Bucket Name**
    * **Cloudflare R2 Endpoint**
    * **Cloudflare R2 Public URL**

    <img src="https://mintcdn.com/magicads/srGibq66qvweFJdz/images/storage/r2/r2-10.png?fit=max&auto=format&n=srGibq66qvweFJdz&q=85&s=b97a20a13a4d867cb46a24a6a3345815" width="932" height="574" data-path="images/storage/r2/r2-10.png" />
  </Step>

  <Step title="Step 12">
    After you are done with configurations, click on **Save** button.
  </Step>
</Steps>

<Check>
  Congratulations! You have successfully comleted the Cloudflare R2 setup process.
</Check>

## Davinci AI Tools which supports storing results in Cloudflare R2

Following AI tools can be store results in Cloudflare R2 Storage
<Note>Support for more AI tools will be added soon, we are actively working on that</Note>

1. **AI Voiceover**
2. **AI Images**
3. **AI Speech to Text**

<Info>Via AI Settings page in Admin Panel, you can set default cloud storage vendor for each of the supported AI tools individually</Info>
