Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Apiframe

Scalekit connector
Open markdown

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

Tools
22
What they doRead · write · destructive
7 · 14 · 17 read14 write1 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 Apiframe connection

    In AgentKit > Connections, create an Apiframe 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 = 'apiframe'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Apiframe:', 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: 'apiframe_jobs_list',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Apiframe 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
  • apiframe_asset_getGet a stored media asset.Read-only

    Get Media Asset

    Get a stored media asset. Returns its status, URL and metadata. Only assets created by your team are accessible.

    Inputs

    asset_idstringrequired
    ID of the asset, from apiframe_asset_create. Example: ast_01JC9B3C4D5E6F7G8H9J0K1L2M.
  • apiframe_job_getGet the status, progress and, when complete, the result of one generation job.Read-only

    Get Job

    Get the status, progress and, when complete, the result of one generation job. Returns status (QUEUED, PROCESSING, COMPLETED, FAILED or CANCELLED), progress and result with the output image, video or audio URLs. Poll this after any generate, edit, upscale or action tool until status is COMPLETED or FAILED.

    Inputs

    job_idstringrequired
    ID of the job, returned by the tool that started it. Example: job_01JC8Z3QH5V7K9M2N4P6R8T0W2.
  • apiframe_jobs_listList generation jobs, newest first, filtered by status, model or text search.Read-only

    List Jobs

    List generation jobs, newest first, filtered by status, model or text search. Returns jobs with id, model, status, progress, created time and result, plus a cursor for the next page. Use apiframe_job_get to poll one job.

    Inputs

    cursorstring
    Cursor from the previous page's response, for the next page. Example: eyJjcmVhdGVkQXQiOiIyMDI2LTExLTE2In0.
    limitinteger
    Jobs per page. Defaults to 20. Example: 20.
    modelstring
    Only jobs for this model id. Example: flux-2-pro.
    scopestring
    user (default) lists your own jobs; team lists every job in the team (admins only). Example: user.one of userteam
    searchstring
    Text to search for in job prompts. Example: snowy cabin.
    statusstring
    Only jobs with this status. Example: COMPLETED.one of QUEUEDPROCESSINGCOMPLETEDFAILEDCANCELLED
  • apiframe_lora_getGet one LoRA, including its training status.Read-only

    Get LoRA

    Get one LoRA, including its training status. Returns the LoRA's id, name, subject kind, status and timestamps. Use this to poll training until the LoRA is ready.

    Inputs

    lora_idstringrequired
    ID of the LoRA, from apiframe_loras_list. Example: lora_01JC9A2B3C4D5E6F7G8H9J0K1L.
  • apiframe_loras_listList the team's trained Flux LoRAs (AI photo models of a person, style or object).Read-only

    List LoRAs

    List the team's trained Flux LoRAs (AI photo models of a person, style or object). Returns each LoRA's id, name, subject kind, status and created time, plus a cursor. Use an id as loraId in apiframe_image_generate with model flux-lora.

    Inputs

    cursorstring
    Cursor from the previous page's response. Example: eyJpZCI6ImxvcmFfMTIzIn0.
    include_archivedstring
    true also lists archived LoRAs. Example: false.one of truefalse
    limitinteger
    LoRAs per page. Defaults to 24. Example: 24.
  • apiframe_me_getGet the authenticated user, their team with its credit balance and plan, and the API key in use.Read-only

    Get Account

    Get the authenticated user, their team with its credit balance and plan, and the API key in use. Returns user, team (credits, plan) and apiKey details. Use this to check the connection and remaining credits.

    Inputs

    This tool takes no inputs.

  • apiframe_models_listList Apiframe's model catalog for image, video and music generation.Read-only

    List Models

    List Apiframe's model catalog for image, video and music generation. Returns each model's id, label, description, supported controls and credit cost range. Use a model id as the model input of the generate tools.

    Inputs

    modalitystring
    Only models of this kind. Example: image.one of imagevideomusic
  • apiframe_asset_createDownload media from a URL and store it in Apiframe storage as a reusable asset.Write

    Create Media Asset

    Download media from a URL and store it in Apiframe storage as a reusable asset. Returns the asset id, status and URL; reference it as asset://<id> in any media URL field of a generation request. Use this for inputs you will reuse across many jobs.

    Inputs

    typestringrequired
    Kind of media. Example: image.one of imagevideoaudio
    urlstringrequired
    Public URL of the media to store. Example: https://example.com/brand-logo.png.