Replicate

Learn how to use Replicate with Composio

Overview

SLUG: REPLICATE

Description

Replicate allows users to run AI models via a cloud API without managing infrastructure.

Authentication Details

bearer_token
stringRequired

Connecting to Replicate

Create an auth config

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

1

Select App

Navigate to Replicate.

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 Replicate 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
4replicate_auth_config_id = "ac_YOUR_REPLICATE_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 Replicate 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, replicate_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 Replicate toolkit’s playground

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Get Account Information

Description

Tool to get authenticated account information. Use when you need to retrieve details about the account associated with the API token.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get model collection

Description

Tool to get a specific collection of models by its slug. Use when you need detailed information about a collection and its models.

Action Parameters

collection_slug
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List model collections

Description

Tool to list all collections of models. Use when you need to retrieve available model collections. Collections are curated groupings of related models.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create file

Description

Tool to create a file by uploading content. Use when you need to upload and store a file for later reference.

Action Parameters

content
stringRequired
filename
stringRequired
metadata
object
type
stringDefaults to application/octet-stream

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Prediction

Description

Tool to create a prediction for a given deployment. Use when you need to run model inference with specified inputs. Use 'wait_for' to wait until the prediction completes.

Action Parameters

deployment_name
stringRequired
deployment_owner
stringRequired
input
objectRequired
wait_for
webhook
webhook_events_filter

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Deployment

Description

Tool to create a new deployment with specified model, version, hardware, and scaling parameters. Use when you need to deploy a model for production use with auto-scaling.

Action Parameters

hardware
stringRequired
max_instances
integerRequired
min_instances
integerRequired
model
stringRequired
name
stringRequired
version
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete Deployment

Description

Tool to delete a deployment from your account. Use when you need to remove a deployment. Deployments must be offline and unused for at least 15 minutes before deletion.

Action Parameters

deployment_name
stringRequired
deployment_owner
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Deployment Details

Description

Tool to get deployment details by owner and name. Use when you need information about a specific deployment including its release configuration and hardware settings.

Action Parameters

deployment_name
stringRequired
deployment_owner
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List deployments

Description

Tool to list all deployments associated with the account. Use when you need to retrieve deployment configurations and their latest releases.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create File

Description

Tool to create or upload a file to Replicate. Use when you need to upload file content with optional metadata.

Action Parameters

content
objectRequired
content_type
stringDefaults to application/octet-stream
metadata

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Delete File

Description

Tool to delete a file by its ID. Use when you need to remove a file from storage. Returns 204 No Content on success.

Action Parameters

file_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get File Details

Description

Tool to get details of a file by its ID. Use when you need to inspect uploaded file information before further operations.

Action Parameters

file_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Files

Description

Tool to retrieve a paginated list of uploaded files. Use to view all files created by the authenticated user or organization. Files are sorted with most recent first.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Available Hardware

Description

Tool to list available hardware SKUs for models and deployments. Use when you need to see what hardware options are available on the Replicate platform.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List model examples

Description

Tool to list example predictions for a specific model. Use when you want to retrieve author-provided illustrative examples after identifying the model.

Action Parameters

model_name
stringRequired
model_owner
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Model Details

Description

Tool to get details of a specific model by owner and name. Use when you need model metadata (schema, URLs) before running predictions.

Action Parameters

model_name
stringRequired
model_owner
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Public Models

Description

Tool to list public models with pagination and sorting. Use when you need to browse available models or find models sorted by creation date.

Action Parameters

cursor
sort_by
sort_direction

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Model Prediction

Description

Tool to create a prediction using an official Replicate model. Use when you need to run inference with a specific model using its owner and name. Supports synchronous waiting (up to 60 seconds) and webhooks for async notifications.

Action Parameters

cancel_after
input
objectRequired
model_name
stringRequired
model_owner
stringRequired
wait_for
webhook
webhook_events_filter

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Model README

Description

Tool to get the README content for a model in Markdown format. Use after retrieving model details when you want to view its documentation.

Action Parameters

model_name
stringRequired
model_owner
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Model Version

Description

Tool to get a specific version of a model. Use when you need details about a particular model version including its schema and metadata.

Action Parameters

model_name
stringRequired
model_owner
stringRequired
version_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Model Versions

Description

Tool to list all versions of a specific model. Use when you need to see all available versions of a model, sorted by newest first.

Action Parameters

model_name
stringRequired
model_owner
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Prediction

Description

Tool to create a prediction to run a model by version ID. Use when you have a specific model version identifier and need to run inference with provided inputs. Supports synchronous waiting and webhook notifications.

Action Parameters

cancel_after
input
objectRequired
stream
version
stringRequired
wait_for
webhook
webhook_events_filter

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List All Predictions

Description

Tool to list all predictions for the authenticated user or organization with pagination. Use when you need to retrieve prediction history or filter predictions by creation date.

Action Parameters

created_after
created_before

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Cancel Training

Description

Tool to cancel an ongoing training operation in Replicate. Use when you need to stop a training job that is in progress.

Action Parameters

training_id
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Create Training Job

Description

Tool to create a training job for a specific model version. Use when you need to fine-tune a model with custom training data. Supports webhook notifications for training status updates.

Action Parameters

destination
stringRequired
input
objectRequired
name
stringRequired
owner
stringRequired
version_id
stringRequired
webhook
webhook_events_filter

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: List Training Jobs

Description

Tool to list all training jobs for the authenticated user or organization with pagination. Use when you need to retrieve training history or check the status of training jobs.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Webhook Signing Secret

Description

Tool to get the signing secret for the default webhook. Use when you need to retrieve the secret key used to verify webhook authenticity.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired