fal-platform

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

fal.ai Platform

fal.ai平台

Platform APIs for model management, pricing, usage tracking, and cost estimation.
平台API,用于模型管理、定价、使用跟踪和成本估算。

Scripts

脚本

ScriptPurpose
setup.sh
Setup FAL_KEY and configuration
pricing.sh
Get model pricing information
usage.sh
Check usage and billing
estimate-cost.sh
Estimate costs for operations
requests.sh
List and manage requests
脚本用途
setup.sh
设置FAL_KEY及配置
pricing.sh
获取模型定价信息
usage.sh
查看使用情况与账单
estimate-cost.sh
估算操作成本
requests.sh
列出并管理请求

Setup & Configuration

设置与配置

Add FAL_KEY

添加FAL_KEY

bash
undefined
bash
undefined

Interactive setup

交互式设置

bash /mnt/skills/user/fal-platform/scripts/setup.sh --add-fal-key
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"
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.
bash /mnt/skills/user/fal-platform/scripts/setup.sh --show-config

这会将FAL_KEY添加到你的`.env`文件中,以便持久使用。

Model Pricing

模型定价

Get pricing for any model:
bash
undefined
获取任意模型的定价:
bash
undefined

Single model pricing

单个模型定价

bash /mnt/skills/user/fal-platform/scripts/pricing.sh --model "fal-ai/flux/dev"
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.1/pro"
bash /mnt/skills/user/fal-platform/scripts/pricing.sh --model "fal-ai/flux/dev,fal-ai/kling-video/v2.1/pro"

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.1/pro Price: $0.50 per second Unit: video_second
undefined
bash /mnt/skills/user/fal-platform/scripts/pricing.sh --category "text-to-image"

**输出:**
fal-ai/flux/dev Price: $0.025 per image Unit: image
fal-ai/kling-video/v2.1/pro Price: $0.50 per second Unit: video_second
undefined

Usage Tracking

使用情况跟踪

Check your usage and spending:
bash
undefined
查看你的使用情况与支出:
bash
undefined

Current period usage

当前周期使用情况

bash /mnt/skills/user/fal-platform/scripts/usage.sh
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"
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"
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`
bash /mnt/skills/user/fal-platform/scripts/usage.sh --timeframe "day"

**时间范围选项:** `minute`, `hour`, `day`, `week`, `month`

Estimate Cost

成本估算

Estimate costs before running:
bash
undefined
在运行前估算成本:
bash
undefined

Estimate by API calls (historical pricing)

根据API调用次数估算(基于历史定价)

bash /mnt/skills/user/fal-platform/scripts/estimate-cost.sh
--model "fal-ai/flux/dev"
--calls 100
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.1/pro"
--units 60
--type "unit_price"

**Output:**
Cost Estimate for fal-ai/flux/dev Quantity: 100 calls Estimated Cost: $2.50
undefined
bash /mnt/skills/user/fal-platform/scripts/estimate-cost.sh
--model "fal-ai/kling-video/v2.1/pro"
--units 60
--type "unit_price"

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

Request Management

请求管理

List and manage requests:
bash
undefined
列出并管理请求:
bash
undefined

List recent requests

列出近期请求

bash /mnt/skills/user/fal-platform/scripts/requests.sh --model "fal-ai/flux/dev" --limit 10
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"
undefined
bash /mnt/skills/user/fal-platform/scripts/requests.sh --delete "request_id_here"
undefined

API Endpoints Reference

API端点参考

OperationEndpointMethod
Model Search
GET /models
GET
Pricing
GET /models/pricing
GET
Usage
GET /models/usage
GET
List Requests
GET /models/requests/by-endpoint
GET
Delete Payloads
DELETE /models/requests/{id}/payloads
DELETE
Base URL:
https://api.fal.ai/v1
操作端点请求方法
模型搜索
GET /models
GET
定价查询
GET /models/pricing
GET
使用情况查询
GET /models/usage
GET
列出请求
GET /models/requests/by-endpoint
GET
删除负载
DELETE /models/requests/{id}/payloads
DELETE
基础URL:
https://api.fal.ai/v1

Common Flags (All Scripts)

通用参数(所有脚本)

All scripts support these common flags:
bash
--add-fal-key [KEY]   # Add/update FAL_KEY in .env
--help, -h            # Show help
--json                # Output raw JSON
--quiet, -q           # Suppress status messages
所有脚本均支持以下通用参数:
bash
--add-fal-key [KEY]   # 在.env中添加/更新FAL_KEY
--help, -h            # 显示帮助信息
--json                # 输出原始JSON格式
--quiet, -q           # 隐藏状态消息

Troubleshooting

故障排除

API Key Required

需要API密钥

Error: FAL_KEY required for this operation

Run: bash /mnt/skills/user/fal-platform/scripts/setup.sh --add-fal-key
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
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