data
fal.ai CLI for AI Agents
Use the fal.ai CLI from KosmoKrator to call fal.ai tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.fal.ai CLI Setup
fal.ai can be configured headlessly with `kosmokrator integrations:configure fal`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure fal --set api_key="$FAL_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor fal --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | FAL_API_KEY | Secret secret | yes | API Key |
url | FAL_URL | URL url | no | API Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call fal.fal_list_models '{}' --json kosmo integrations:fal fal_list_models '{}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs fal --json
kosmo integrations:docs fal.fal_list_models --json
kosmo integrations:schema fal.fal_list_models --json
kosmo integrations:search "fal.ai" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
fal.fal_list_models
List available fal.ai models. Returns model IDs, descriptions, and capabilities.
read - Parameters
- none
kosmo integrations:call fal.fal_list_models '{}' --json kosmo integrations:fal fal_list_models '{}' --json fal.fal_submit_request
Submit a generation request to a fal.ai model. Returns the request ID for tracking. Poll get_request_status for progress.
write - Parameters
- model_id, input, webhook_url
kosmo integrations:call fal.fal_submit_request '{"model_id":"example_model_id","input":"example_input","webhook_url":"example_webhook_url"}' --json kosmo integrations:fal fal_submit_request '{"model_id":"example_model_id","input":"example_input","webhook_url":"example_webhook_url"}' --json fal.fal_get_request_status
Get the status of a submitted fal.ai request. Returns queue position and processing state.
read - Parameters
- model_id, request_id
kosmo integrations:call fal.fal_get_request_status '{"model_id":"example_model_id","request_id":"example_request_id"}' --json kosmo integrations:fal fal_get_request_status '{"model_id":"example_model_id","request_id":"example_request_id"}' --json fal.fal_get_result
Get the result of a completed fal.ai request. Returns generated media URLs and metadata.
read - Parameters
- model_id, request_id
kosmo integrations:call fal.fal_get_result '{"model_id":"example_model_id","request_id":"example_request_id"}' --json kosmo integrations:fal fal_get_result '{"model_id":"example_model_id","request_id":"example_request_id"}' --json fal.fal_list_files
List files stored in fal.ai storage. Returns file names, URLs, and metadata.
read - Parameters
- none
kosmo integrations:call fal.fal_list_files '{}' --json kosmo integrations:fal fal_list_files '{}' --json fal.fal_upload_file
Upload a file to fal.ai storage for use as model input. Returns the file URL.
write - Parameters
- file_path, file_name
kosmo integrations:call fal.fal_upload_file '{"file_path":"example_file_path","file_name":"example_file_name"}' --json kosmo integrations:fal fal_upload_file '{"file_path":"example_file_path","file_name":"example_file_name"}' --json fal.fal_get_current_user
Get current fal.ai user profile and account information.
read - Parameters
- none
kosmo integrations:call fal.fal_get_current_user '{}' --json kosmo integrations:fal fal_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
fal.fal_list_models 0 parameters
kosmo integrations:schema fal.fal_list_models --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
fal.fal_submit_request 3 parameters
kosmo integrations:schema fal.fal_submit_request --json | Parameter | Type | Required | Description |
|---|---|---|---|
model_id | string | yes | The model identifier (e.g., "fal-ai/flux/schnell"). |
input | object | yes | An object of model input values (e.g., prompt, image_url, etc.). |
webhook_url | string | no | A URL to receive POST notifications when the request completes. |
fal.fal_get_request_status 2 parameters
kosmo integrations:schema fal.fal_get_request_status --json | Parameter | Type | Required | Description |
|---|---|---|---|
model_id | string | yes | The model identifier used when submitting the request. |
request_id | string | yes | The request ID returned by submit_request. |
fal.fal_get_result 2 parameters
kosmo integrations:schema fal.fal_get_result --json | Parameter | Type | Required | Description |
|---|---|---|---|
model_id | string | yes | The model identifier used when submitting the request. |
request_id | string | yes | The request ID returned by submit_request. |
fal.fal_list_files 0 parameters
kosmo integrations:schema fal.fal_list_files --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
fal.fal_upload_file 2 parameters
kosmo integrations:schema fal.fal_upload_file --json | Parameter | Type | Required | Description |
|---|---|---|---|
file_path | string | yes | The local file path to upload. |
file_name | string | no | Custom file name for the upload. Defaults to the original file name. |
fal.fal_get_current_user 0 parameters
kosmo integrations:schema fal.fal_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.