mcpField
F
fal-platform

fal-platform

github.com/fal-ai-communityCloud & DevOps257221 installsUpdated 24w ago
Repository

About fal-platform

fal-platform is a set of scripts for managing fal.ai platform data, for users who need model pricing, usage, and request records. It also estimates operation costs and manages request payloads.

Key features

  1. 01Look up model pricing
  2. 02Track usage and spending
  3. 03Estimate operation costs
  4. 04List and manage requests
  5. 05Configure FAL_KEY

Use cases

  1. 01Estimate costs before running models
  2. 02Review usage by model or date
  3. 03Clean up request payloads

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fal-ai-community/skills --skill fal-platform

After installing, type/fal-platformin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

scripts/
estimate-cost.sh
pricing.sh
requests.sh
setup.sh
usage.sh

Details

From the project README

fal.ai Platform

Platform APIs for model management, pricing, usage tracking, and cost estimation.

Scripts

ScriptPurpose
setup.shSetup FAL_KEY and configuration
pricing.shGet model pricing information
usage.shCheck usage and billing
estimate-cost.shEstimate costs for operations
requests.shList and manage requests

Setup & Configuration

Add FAL_KEY
# Interactive setup
bash /mnt/skills/user/fal-platform/scripts/setup.sh --add-fal-key

# Set key directly
bash /mnt/skills/user/fal-platform/scripts/setup.sh --add-fal-key "your_key_here"

# Show current config
bash /mnt/skills/user/fal-platform/scripts/setup.sh --show-config

This adds FAL_KEY to your .env file for persistent use.

Model Pricing

Get pricing for any model:

# Single model pricing
bash /mnt/skills/user/fal-platform/scripts/pricing.sh --model "fal-ai/flux/dev"

# Multiple models
bash /mnt/skills/user/fal-platform/scripts/pricing.sh --model "fal-ai/flux/dev,fal-ai/kling-video/v2/master/text-to-video"

# All pricing for a category
bash /mnt/skills/user/fal-platform/scripts/pricing.sh --category "text-to-image"

Output:

fal-ai/flux/dev
  Price: $0.025 per image
  Unit: image

fal-ai/kling-video/v2/master/text-to-video
  Price: $0.50 per second
  Unit: video_second

Usage Tracking

Check your usage and spending:

# Current period usage
bash /mnt/skills/user/fal-platform/scripts/usage.sh

# Filter by model
bash /mnt/skills/user/fal-platform/scripts/usage.sh --model "fal-ai/flux/dev"

# Date range
bash /mnt/skills/user/fal-platform/scripts/usage.sh --start "2024-01-01" --end "2024-01-31"

# Specific timeframe
bash /mnt/skills/user/fal-platform/scripts/usage.sh --timeframe "day"

Timeframes: minute, hour, day, week, month

Estimate Cost

Estimate costs before running:

# Estimate by API calls (historical pricing)
bash /mnt/skills/user/fal-platform/scripts/estimate-cost.sh \
  --model "fal-ai/flux/dev" \
  --calls 100

# Estimate by units
bash /mnt/skills/user/fal-platform/scripts/estimate-cost.sh \
  --model "fal-ai/kling-video/v2/master/text-to-video" \
  --units 60 \
  --type "unit_price"

Output:

Cost Estimate for fal-ai/flux/dev
  Quantity: 100 calls
  Estimated Cost: $2.50

Request Management

List and manage requests:

# List recent requests
bash /mnt/skills/user/fal-platform/scripts/requests.sh --model "fal-ai/flux/dev" --limit 10

# Delete request payloads (cleanup)
bash /mnt/skills/user/fal-platform/scripts/requests.sh --delete "request_id_here"

API Endpoints Reference

OperationEndpointMethod
Model SearchGET /modelsGET
PricingGET /models/pricingGET
UsageGET /models/usageGET
List RequestsGET /models/requests/by-endpointGET
Delete PayloadsDELETE /models/requests/{id}/payloadsDELETE

Base URL: https://api.fal.ai/v1

Common Flags (All Scripts)

All scripts support these common flags:

--add-fal-key [KEY]   # Add/update FAL_KEY in .env
--help, -h            # Show help
--json                # Output raw JSON
--quiet, -q           # Suppress status messages

Troubleshooting

API Key Required
Error: FAL_KEY required for this operation

Run: bash /mnt/skills/user/fal-platform/scripts/setup.sh --add-fal-key
Permission Denied
Error: API key doesn't have permission for this operation

Some operations require admin API keys. Check your key permissions at:
https://fal.ai/dashboard/keys

Comments

Markdown supported