Imagekit io

Learn how to use Imagekit io with Composio

Overview

SLUG: IMAGEKIT_IO

Description

ImageKit.io is a comprehensive media management solution offering real-time image and video optimization, transformation, and delivery through a global content delivery network (CDN).

Authentication Details

generic_api_key
stringRequired

Connecting to Imagekit io

Create an auth config

Use the dashboard to create an auth config for the Imagekit io toolkit. This allows you to connect multiple Imagekit io accounts to Composio for agents to use.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Imagekit io Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4imagekit_io_auth_config_id = "ac_YOUR_IMAGEKIT_IO_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Imagekit io for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, imagekit_io_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the [Imagekit io toolkit’s playground](https://app.composio.dev/app/Imagekit io)

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["IMAGEKIT_IO"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Bulk Job Status

Description

Tool to check status of a bulk job. Use when monitoring progress of a bulk copy or move folder operation.

Action Parameters

jobId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Bulk Move Files

Description

Tool to move multiple files in bulk. Use when you need to relocate up to 100 ImageKit files to a specified folder in one API call.

Action Parameters

destinationPath
stringRequired
fileIds
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Bulk Remove Tags

Description

Tool to remove tags from multiple files in bulk. Use when you need to strip specified tags from up to 50 existing files in one API call.

Action Parameters

fileIds
arrayRequired
tags
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Copy Folder

Description

Tool to initiate a bulk copy of a folder. Use when you need to asynchronously duplicate a directory (optionally including all versions) at another path in ImageKit. Returns a jobId to track progress with IMAGEKIT_IO_BULK_JOB_STATUS.

Action Parameters

destinationPath
stringRequired
includeVersions
boolean
sourceFolderPath
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Custom Metadata Field

Description

Tool to create a custom metadata field. Use when you need to define a new field in ImageKit DAM.

Action Parameters

label
stringRequired
name
stringRequired
schema
objectRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Create Folder

Description

Tool to create a new folder. Use when you need to organize assets into a structured folder hierarchy.

Action Parameters

folderName
stringRequired
parentFolderPath
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Custom Metadata Field

Description

Tool to delete a custom metadata field. Use when you have the field ID and need to permanently remove the metadata schema field. Call after confirming irreversible deletion.

Action Parameters

fieldId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete File

Description

Tool to delete a file. Use when you have the file ID and need to permanently remove the file. Call after confirming irreversible deletion.

Action Parameters

fileId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete File Version

Description

Tool to delete a specific non-current file version. Use when permanently removing an older version of a file.

Action Parameters

fileId
stringRequired
versionId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Folder

Description

Tool to delete a folder. Use when you need to permanently remove an existing folder and its contents. Call after confirming irreversible deletion.

Action Parameters

folderPath
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Delete Multiple Files

Description

Tool to delete multiple files. Use when you need to remove up to 100 assets by their file IDs in one batch operation.

Action Parameters

fileIds
arrayRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Upload Authentication Parameters

Description

Tool to generate authentication parameters for client-side file uploads. Use when preparing client-side uploads.

Action Parameters

expireIn
integerDefaults to 3600
token
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get File Details

Description

Tool to retrieve details of a specific file. Use after uploading or listing assets to get full metadata.

Action Parameters

fileId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get File Metadata

Description

Tool to retrieve metadata of an uploaded file. Use after confirming a successful upload to get EXIF, pHash, dimensions, and other image metadata.

Action Parameters

fileId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get File Version Details

Description

Tool to retrieve details of a specific file version. Use after listing or uploading assets when you need to inspect version metadata.

Action Parameters

fileId
stringRequired
versionId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Get Usage

Description

Tool to retrieve account usage metrics. Use when you need usage stats for a specific date range (max 90 days).

Action Parameters

endDate
stringRequired
startDate
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List and Search Assets

Description

Tool to list and search assets in your ImageKit account. Use when you want to retrieve or filter media library assets by criteria such as name, tags, folder path, or advanced queries.

Action Parameters

fileType
string
limit
integer
name
string
path
string
searchQuery
string
skip
integer
sort
string
tags
string
type
string

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: List Custom Metadata Fields

Description

Tool to list all custom metadata fields. Use when you need to retrieve all defined metadata fields, optionally including deleted ones.

Action Parameters

includeDeleted
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: List File Versions

Description

Tool to list all versions of a file. Use after confirming the fileId to retrieve all historical and published versions of an asset.

Action Parameters

fileId
stringRequired

Action Response

data
arrayRequired
error
string
successful
booleanRequired

Tool Name: Move Folder

Description

Tool to initiate a bulk move of a folder. Use when you need to asynchronously relocate a directory to another path in ImageKit. Returns a jobId to track progress with IMAGEKIT_IO_BULK_JOB_STATUS.

Action Parameters

destinationPath
stringRequired
sourceFolderPath
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Purge ImageKit Cache

Description

Tool to purge CDN and ImageKit caches for a given URL. Use when you need to invalidate cached content on ImageKit.

Action Parameters

url
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Check purge cache status

Description

Tool to check the status of a cache purge request. Use after initiating a purge to retrieve its current state. Example: "What's the status of purge request id abc123?"

Action Parameters

requestId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Rename File

Description

Tool to rename a file. Use when you need to update an existing asset's name; optionally purge CDN cache for old URLs.

Action Parameters

filePath
stringRequired
newFileName
stringRequired
purgeCache
boolean

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Restore File Version

Description

Tool to restore a specific non-current file version as the current one. Use when you need to revert a file to a previous version after confirming the versionId.

Action Parameters

fileId
stringRequired
versionId
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update Custom Metadata Field

Description

Tool to update an existing custom metadata field. Use when you need to modify the label or schema of a metadata field.

Action Parameters

fieldId
stringRequired
label
string
schema
object

Action Response

data
objectRequired
error
string
successful
booleanRequired

Tool Name: Update File Details

Description

Tool to update details of a file. Use when you need to modify tags, coordinates, metadata, or extensions on an ImageKit asset.

Action Parameters

customCoordinates
string
customMetadata
object
extensions
array
fileId
stringRequired
removeAITags
array
tags
array
webhookUrl
string

Action Response

data
objectRequired
error
string
successful
booleanRequired