Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Fal AI

Scalekit connector
Open markdown

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

Tools
29
What they doRead · write · destructive
21 · 7 · 121 read7 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 Fal AI connection

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

    Each user opens the link once and enters their Fal AI 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
  • fal_browse_assetsBrowse or semantically search the fal Assets library across uploads, generations, favorites and collections.Read-only

    Browse Assets

    Browse or semantically search the fal Assets library across uploads, generations, favorites and collections. Returns assets with asset_id, url, type, title, endpoint and created_at, plus a cursor for the next page. Use fal_get_asset for one asset.

    Inputs

    collection_idstring
    Only assets in this collection.
    cursorstring
    Pagination cursor from the previous response's next_cursor. Keep all other filters unchanged while paging.
    limitinteger
    Maximum number of items to return per page.
    qstring
    Text query for semantic search.
    search_image_urlstring
    Image URL for visual similarity search.
    search_video_urlstring
    Video URL for visual similarity search.
    sectionstring
    Library section to browse. Defaults to all-media.one of all-mediauploadsfavoritesgenerated
  • fal_estimate_costEstimate the cost of a planned workload on fal models.Read-only

    Estimate Cost

    Estimate the cost of a planned workload on fal models. This only reads pricing and creates nothing. Returns estimate_type, total_cost and currency. Use before large runs; use fal_get_model_pricing for raw unit prices.

    Inputs

    endpointsobjectrequired
    Object mapping each endpoint ID to its quantity. For historical_api_price use {"call_quantity": 100}; for unit_price use {"unit_quantity": 100}. Example: {"fal-ai/flux/dev": {"unit_quantity": 100}}.
    estimate_typestringrequired
    Estimation method: historical_api_price (cost per API call, endpoints map to call_quantity) or unit_price (unit price times billing units, endpoints map to unit_quantity).one of historical_api_priceunit_price
  • fal_get_account_billingGet billing information for the authenticated fal account.Read-only

    Get Account Billing

    Get billing information for the authenticated fal account. Returns username and, when expand includes credits, credits with current_balance and currency. Use to check the remaining credit balance.

    Inputs

    expandstring
    Extra details to include. Use credits to include the credit balance.
  • fal_get_app_queue_sizeGet the number of requests currently waiting in a Serverless app's queue.Read-only

    Get App Queue Size

    Get the number of requests currently waiting in a Serverless app's queue. Returns queue_size. Needs an API key with serverless queue read permission (SERVERLESS, READONLY or FULL preset).

    Inputs

    namestringrequired
    App name.
    ownerstringrequired
    Owner (username or team) of the app.
  • fal_get_assetGet one asset from the fal Assets library by asset ID or vector ID.Read-only

    Get Asset

    Get one asset from the fal Assets library by asset ID or vector ID. Returns the asset with asset_id, url, type, title, endpoint, source and created_at. Find IDs with fal_browse_assets.

    Inputs

    asset_idstringrequired
    Asset ID (a vector ID is also accepted).
  • fal_get_asset_collectionGet one collection from the fal Assets library.Read-only

    Get Asset Collection

    Get one collection from the fal Assets library. Returns the collection with id, type, name, icon, color, cover_image_url and parent_collection_id. Find IDs with fal_list_asset_collections.

    Inputs

    collection_idstringrequired
    ID of the collection.
  • fal_get_model_analyticsGet time-bucketed request metrics for fal model endpoints.Read-only

    Get Model Analytics

    Get time-bucketed request metrics for fal model endpoints. Returns buckets with request, success and error counts and latency percentiles per endpoint_id, plus next_cursor. Use for reliability and latency monitoring; use fal_get_model_usage for cost.

    Inputs

    endpoint_idstringrequired
    Endpoint ID(s) to query, comma-separated (up to 50). Example: fal-ai/flux/dev,fal-ai/flux/schnell.
    bound_to_timeframestring
    Whether start and end are aligned to timeframe boundaries with an exclusive end. Defaults to true.one of truefalse
    cursorstring
    Pagination cursor from the previous response's next_cursor. Keep all other filters unchanged while paging.
    endstring
    End of the time range (exclusive), as an ISO 8601 date or datetime. Defaults to now.
    expandstring
    Metrics to include, comma-separated: time_series, request_count, success_count, error_count, p50_duration, p90_duration and similar. Defaults to time_series,request_count.
    limitinteger
    Maximum number of items to return per page.
    startstring
    Start of the time range, as an ISO 8601 date or datetime. Defaults to 24 hours ago.
    timeframestring
    Aggregation bucket size. Auto-detected from the date range when omitted.one of minutehourdayweekmonth
    timezonestring
    IANA timezone used to bucket dates, for example UTC or America/New_York.
  • fal_get_model_pricingGet unit pricing for one or more fal model endpoints.Read-only

    Get Model Pricing

    Get unit pricing for one or more fal model endpoints. Returns prices with endpoint_id, unit_price, unit and currency. Use to compare model costs; use fal_estimate_cost to project the cost of a planned workload.

    Inputs

    endpoint_idstringrequired
    Endpoint ID(s) to price, comma-separated (up to 50). Example: fal-ai/flux/dev,fal-ai/flux/schnell.