Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Replicate

Scalekit connector
Open markdown

The Replicate connector lets your AI agent act in each user's Replicate account. Each user connects their own Replicate access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 33 tools.

Tools
33
What they doRead · write · destructive
19 · 10 · 419 read10 write4 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Replicate connection

    In AgentKit > Connections, create a Replicate connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'replicate'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Replicate:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'replicate_get_account',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Replicate credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • replicate_get_accountGet the user or organization that owns the API token in use.Read-only

    Get Account

    Get the user or organization that owns the API token in use. Returns the account type (user or organization), username, display name, GitHub URL and avatar URL. Use it to confirm which account the connection is authenticated as; the username is the owner value for models and deployments you create.

    Inputs

    This tool takes no inputs.

  • replicate_get_collectionGet one collection of models by slug.Read-only

    Get Collection

    Get one collection of models by slug. Returns the collection's name, slug, description, full_description and its models array. Use replicate_list_collections to find collection slugs.

    Inputs

    collection_slugstringrequired
    Slug of the collection, such as 'super-resolution' or 'image-restoration'. Get slugs from replicate_list_collections.
  • replicate_get_deploymentGet one deployment by owner and name.Read-only

    Get Deployment

    Get one deployment by owner and name. Returns the deployment's owner, name and current_release (release number, model, version, creator and configuration with hardware, min_instances and max_instances). Use replicate_list_deployments to find deployments.

    Inputs

    deployment_namestringrequired
    Name of the deployment.
    deployment_ownerstringrequired
    Username or organization that owns the deployment.
  • replicate_get_fileGet the details of one uploaded file by ID.Read-only

    Get File

    Get the details of one uploaded file by ID. Returns the file's id, content_type, size, checksums, metadata, created_at, expires_at and urls. Use replicate_list_files to find file IDs.

    Inputs

    file_idstringrequired
    ID of the file, returned in the 'id' field when it was uploaded.
  • replicate_get_modelGet one model by owner and name.Read-only

    Get Model

    Get one model by owner and name. Returns the model's url, owner, name, description, visibility, run_count, GitHub, paper and license URLs, cover image, default_example and latest_version. Use replicate_list_model_versions for all versions, replicate_get_model_readme for the README, and replicate_search to find a model first.

    Inputs

    model_namestringrequired
    Name of the model within the owner's account, such as 'flux-schnell' or 'hello-world'.
    model_ownerstringrequired
    Username or organization that owns the model, such as 'black-forest-labs' or 'replicate'.
  • replicate_get_model_readmeGet the README of a model as Markdown text.Read-only

    Get Model README

    Get the README of a model as Markdown text. Returns the README content as plain text. Use replicate_get_model for structured metadata such as description, visibility and latest_version.

    Inputs

    model_namestringrequired
    Name of the model within the owner's account, such as 'flux-schnell' or 'hello-world'.
    model_ownerstringrequired
    Username or organization that owns the model, such as 'black-forest-labs' or 'replicate'.
  • replicate_get_model_versionGet one version of a model by version ID.Read-only

    Get Model Version

    Get one version of a model by version ID. Returns the version's id, created_at, cog_version and openapi_schema, whose Input and Output schemas list the fields to pass to a prediction. Use replicate_list_model_versions to find version IDs.

    Inputs

    model_namestringrequired
    Name of the model within the owner's account, such as 'flux-schnell' or 'hello-world'.
    model_ownerstringrequired
    Username or organization that owns the model, such as 'black-forest-labs' or 'replicate'.
    version_idstringrequired
    64-character ID of the model version. Get it from replicate_list_model_versions.
  • replicate_get_predictionGet the current state of a prediction by ID.Read-only

    Get Prediction

    Get the current state of a prediction by ID. Returns status (starting, processing, succeeded, failed, canceled or aborted), input, output, logs, error, metrics, timestamps and urls. Use it to poll a prediction started with a create-prediction tool. Use replicate_list_predictions to browse recent predictions.

    Inputs

    prediction_idstringrequired
    ID of the prediction, returned in the 'id' field when it was created.