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

# Cloudinary

> Learn how to use the Cloudinary integration with Julep

## Overview

Welcome to the Cloudinary integration guide for Julep! This integration allows you to manage and transform media files efficiently, enabling you to build workflows that require robust media processing capabilities. Whether you're uploading images or editing videos, this guide will walk you through the setup and usage.

## Prerequisites

<Info type="info" title="API Key Required">
  To use the Cloudinary integration, you need an API key, API secret, and cloud name. You can obtain these by signing up at [Cloudinary](https://cloudinary.com/signup).
</Info>

## How to Use the Integration

To get started with the Cloudinary integration, follow these steps to configure and create a task:

<Steps>
  <Step title="Configure Your API Key">
    Add your API key, API secret, and cloud name to the tools section of your task. This will allow Julep to authenticate requests to Cloudinary on your behalf.
  </Step>

  <Step title="Create Task Definition">
    Use the following YAML configuration to define your media processing task:

    ```yaml Cloudinary Example [expandable] theme={"dark"}
    name: Cloudinary Task

    tools:
    - name: cloudinary_tool
      type: integration
      integration:
        provider: cloudinary
        method: media_upload
        setup:
          cloudinary_cloud_name: "CLOUDINARY_CLOUD_NAME"
          cloudinary_api_key: "CLOUDINARY_API_KEY"
          cloudinary_api_secret: "CLOUDINARY_API_SECRET"
          params: # Optional setup parameters
            key1: "value1" # these are placeholders for the actual parameters
            key2: "value2" # these are placeholders for the actual parameters

    main:
    - tool: cloudinary_tool
      arguments:
        file: https://example.com/image.jpg # this is a placeholder for the actual file
        public_id: my_image # this is a placeholder for the actual public id
        upload_params: # Optional upload parameters
          param1: value1 # these are placeholders for the actual parameters
          param2: value2 # these are placeholders for the actual parameters
        return_base64: false
    ```
  </Step>
</Steps>

### YAML Explanation

<AccordionGroup>
  <Accordion title="Basic Configuration">
    * ***name***: A descriptive name for the task, in this case, "Cloudinary Task".
    * ***tools***: This section lists the tools or integrations being used. Here, `cloudinary_tool` is defined as an integration tool.
  </Accordion>

  <Accordion title="Tool Configuration">
    * ***type***: Specifies the type of tool, which is `integration` in this context.
    * ***integration***: Details the provider and setup for the integration.
      * ***provider***: Indicates the service provider, which is `cloudinary` for Cloudinary.
      * ***method***: Specifies the method to use, either `media_upload` or `media_edit`. Defaults to `media_edit` if not specified.
      * ***setup***: Contains configuration details
        * ***cloudinary\_cloud\_name***: (Required) The cloud name of the Cloudinary account.
        * ***cloudinary\_api\_key***: (Required) The API key of the Cloudinary account.
        * ***cloudinary\_api\_secret***: (Required) The API secret of the Cloudinary account.
        * ***params***: (Optional) Optional parameters for the configuration.
  </Accordion>

  <Accordion title="Workflow Configuration">
    * ***main***: Defines the main execution steps.
      * ***tool***: Refers to the tool defined earlier (`cloudinary_tool`).
      * ***arguments***: Specifies the input parameters for the tool:
            <Accordion title="media_upload">
              * ***file***: The URL of the file to upload. More details can be found in the [Cloudinary documentation](https://cloudinary.com/documentation/image_upload_api_reference#upload).
              * ***public\_id***: (optional) Optional public ID for the uploaded file. Defaults to None.
              * ***upload\_params***: (optional) Optional transformations for the upload. Defaults to None.
              * ***return\_base64***: (optional) Whether to return the file in base64 encoding. Defaults to False.
            </Accordion>
            <Accordion title="media_edit">
              * ***public\_id***: The public ID of the file to edit.
              * ***transformation***: The transformations to apply to the file.
              * ***return\_base64***: Whether to return the transformed file in base64 encoding.
            </Accordion>
  </Accordion>
</AccordionGroup>

<Note>
  Remember to replace `CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_API_KEY`, and `CLOUDINARY_API_SECRET` with your actual credentials.
</Note>

<Note>
  The different parameters available for the Cloudinary integration can be found in the [Cloudinary API documentation](https://cloudinary.com/documentation/cloudinary_sdks#configuration_parameters).
</Note>

## Conclusion

With the Cloudinary integration, you can efficiently manage and transform media files.
This integration provides a robust solution for media processing, enhancing your workflow's capabilities and user experience.

<Tip>
  For more information, please refer to the [Cloudinary documentation](https://cloudinary.com/documentation/python_quickstart).
</Tip>
