Prepare
Save the model ID, JSON input, estimate, and maximum spend. The output includes a job ID and approval hash.
bun run src/cli.ts prepare fal-ai/flux/schnell input.json 0.01 0.10
LOCAL RUNNER / FAL.AI
The agent can prepare and follow a generation job. A trusted reviewer accepts the exact request and its spending limit before anything reaches fal.ai.
Trace a job ↓THE RUNBOOK
The agent host can prepare, submit, poll, and fetch. The approval command must run from a trusted shell that the agent cannot call.
Save the model ID, JSON input, estimate, and maximum spend. The output includes a job ID and approval hash.
bun run src/cli.ts prepare fal-ai/flux/schnell input.json 0.01 0.10
Inspect the model, input, estimate, and maximum. The hash binds this approval to that saved request; it does not authenticate the reviewer.
bun run src/approve.ts JOB_ID APPROVAL_HASH REVIEWER_ID
With FAL_KEY configured, the runner writes submitting before the network call. A repeated submission is rejected.
bun run src/cli.ts submit JOB_ID APPROVAL_HASH
Once fal returns a request ID, the runner can resume queue checks after a restart.
bun run src/cli.ts status JOB_ID
completed means processing finished. delivered means a local MP4, PNG, or JPEG passed signature checks and has a recorded SHA-256 and byte count.
bun run src/cli.ts fetch JOB_ID ./outputs
WHEN THE NETWORK FAILS
If submit times out, the manifest becomes uncertain. Inspect the fal dashboard or provider API before creating any new job. The runner will not retry the request for you.
The queue completed, but the media URL or download failed. Retry fetch, not submit.
The provider may have accepted the request. Check its state before spending again.
The estimate comes from the caller. This tool does not fetch current model prices or validate each model's input schema. Review both against the model documentation.
LOCAL, SINGLE HOST