canonical: https://jentic.com/apis/fal.ai/fal

# fal Platform APIs

fal is a managed inference platform for generative AI models, with a particular focus on image, video, and audio diffusion. The platform API exposes 32 endpoints covering model discovery and pricing, request usage and analytics, workflows, and serverless app queues. It is built for teams that want to call hosted generative models, monitor usage, and orchestrate workflows without running inference servers themselves.

## For AI agents

Discover hosted generative AI models on fal, estimate pricing, run inference through the serverless queue, and inspect usage and analytics. Useful for image, video, and audio generation flows.

## Scope

Does not handle model training, dataset hosting, or fine-tuning beyond what's exposed by hosted models - use for hosted generative inference, pricing, and workflow orchestration only.

## Capabilities

- List models available on the fal platform with their pricing
- Estimate the cost of a model call before submitting it
- Submit a generative inference request to the serverless app queue
- Search past inference requests by endpoint or query
- Read usage, analytics, and billing events for a workspace
- Manage workflows that chain multiple models together
- Delete stored payloads attached to past requests

## Use cases

### Generative Image Inference

An application generates product images on demand by submitting prompts to a hosted diffusion model on fal. The flow lists available models via /models, optionally estimates cost via `/models/pricing/estimate`, and submits the request to the serverless app queue. Returns generated assets without the team running any GPU infrastructure.

Example prompt: Call GET /models to find a suitable image model, POST the prompt to `/models/pricing/estimate` to confirm cost, then submit the inference request to the serverless app queue and poll for the generated asset.

### Workflow Chaining

A media pipeline chains two models - an image generator followed by an upscaler - into a single fal workflow. The /workflows endpoints list and resolve workflow definitions by username and workflow name, and the queue endpoints submit requests against them. Reduces orchestration complexity for multi-step generative flows.

Example prompt: Call GET /workflows to find an existing workflow, then GET `/workflows/{username}/{workflow_name}` to resolve its definition, and submit a request through the serverless app queue with the workflow inputs.

### Cost Estimation Before Submission

A finance-aware application estimates the cost of a model call before submitting it to avoid runaway spend on generative workloads. The flow uses `/models/pricing/estimate` with the prompt parameters and returns a price the user can approve before the request is queued. Suited to consumer-facing apps where cost guardrails matter.

Example prompt: POST the model id and parameters to `/models/pricing/estimate`, surface the returned price to the user for approval, and only then submit the inference request to the queue.

### Usage and Billing Analytics

An ops engineer monitors generative spend across a workspace by reading usage, analytics, and billing events from fal. The `/models/usage`, `/models/analytics`, and `/models/billing-events` endpoints expose request counts, latency, and cost over time so the team can track which models are driving spend. Designed for weekly cost reviews on a generative product.

Example prompt: Call GET `/models/usage` and GET `/models/billing-events` for the workspace, group results by model id, and return the top spenders for the past week.

### AI Agent Generative Helper

An AI agent that produces marketing assets on demand uses Jentic to discover the fal model catalogue and submit inference requests without holding the API key. Jentic exposes the 32 fal operations with their input schemas, so the agent can list models, estimate cost, and queue a request inside a single conversation. Designed for marketing or creative teams running an internal generative assistant.

Example prompt: Call jentic.search with 'run a fal image model', load /models to find the right model id, and submit the inference request through the serverless app queue with the user's prompt.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/models` | List available models on the platform |
| GET | `/models/pricing` | Read model pricing |
| POST | `/models/pricing/estimate` | Estimate the cost of a model call |
| GET | `/models/usage` | Read workspace usage |
| GET | `/models/billing-events` | Read billing events |
| GET | `/workflows` | List workflows |
| GET | `/serverless/apps/{owner}/{name}/queue` | Inspect the serverless app queue |

## Key resources

- **Models** — List available models, pricing, usage, analytics, and billing events
- **Requests** — Search and inspect past inference requests
- **Workflows** — Define and resolve multi-step model workflows
- **Serverless Apps** — Submit inference requests through the serverless app queue

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 70 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 67 / 100
  - Developer Experience & Jentic Compatibility: 74 / 100
  - AI-Readiness & Agent Experience: 63 / 100
  - Agent Usability: 94 / 100
  - Security: 50 / 100
  - AI Discoverability: 100 / 100
- **View full report:** https://jentic.com/apis/fal.ai/fal/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the fal Platform APIs by hand means placing your key in the Authorization header, choosing between the standard and admin keys, targeting the api.fal.ai/v1 host, and navigating a 32-endpoint surface yourself. Through Jentic you install once, import the fal Platform APIs from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** fal puts the app owner and name in the URL path (`/serverless/apps/{owner}/{name}/queue`), so a rule can pin your agent to one app while it reads models, pricing, and usage. You choose the operations it may call, so admin-key actions like key management are not included unless you add them.
- **Credential handling:** Your fal API key is stored once, encrypted, by your own Jentic One instance and attached to the Authorization header at execution time. The key never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'run a fal image model' or 'estimate fal cost', and Jentic returns the matching fal operation with its input schema so the agent lists models and submits inference without reading the docs.

## Related APIs

- **Replicate** — Hosted model inference platform with a similar serverless model surface
- **Stability AI** — First-party Stable Diffusion inference API
- **Hugging Face** — Inference Endpoints and Inference API for hosted model calls
- **OpenAI** — Language model platform that pairs with fal's generative media inference

## FAQ

### What authentication does the fal API use?

fal uses an API key in the Authorization header. The spec defines two apiKey schemes (apiKey and adminApiKey) for end-user and workspace-admin operations. Through Jentic both keys are held in the vault and the correct one is attached at execution time.

### Can I run a hosted diffusion model with the fal API?

Yes. List the available models via GET /models, optionally call POST `/models/pricing/estimate` for a price preview, and submit the request through the serverless app queue. fal handles GPU scheduling and returns the generated asset.

### What are the rate limits for the fal API?

Numeric per-second rate limits are not declared in the spec. fal enforces concurrency limits per workspace and per model - inspect the queue endpoint for live concurrency state and read `/models/usage` for historical throughput.

### How do I estimate cost before submitting a request through Jentic?

Run pip install jentic, call jentic.search with 'estimate fal model cost', load the `/models/pricing/estimate` operation, and execute it with the model id and parameters. The returned cost is delivered to the agent before the inference request is submitted.

### Does the fal API support multi-model workflows?

Yes. The /workflows endpoints list workflows and GET `/workflows/{username}/{workflow_name}` resolves a specific workflow definition. Inference requests can target a workflow rather than a single model so multi-step pipelines run as one queue submission.

### How do I track generative spend with the fal API?

Call GET `/models/usage` and GET `/models/billing-events` for workspace-level cost data. The endpoints expose request counts, latency, and billed cost per model so a spend dashboard can be built on top without further integration.

### Can I limit what my agent is allowed to do with the fal API?

Yes. Because you run Jentic One yourself, your own rules decide which of the 32 fal operations and which API key your agent may use. fal puts the app owner and name in the URL path (`/serverless/apps/{owner}/{name}/queue`), so you can pin the agent to one app while it reads models, pricing, and usage. Admin-key actions such as key management are excluded unless you explicitly allow them.
