# fal.ai — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API |
> |---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Generative AI platform — 600+ models for image, video, audio generation and more.

**Category:** AI / Generative | **Website:** [fal.ai](https://fal.ai) | **Docs:** [docs.fal.ai](https://docs.fal.ai)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/fal/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

> Also available via public x402 on Base (no account needed): [x402/fal.md](https://beta.paywithlocus.com/x402/fal.md)

## Endpoints

### Generate

Queue an image or video generation request. Use status_url/result_url from the response with the polling endpoints.

**Estimated cost:** $0.006–$10+ depending on model, duration, resolution, and audio

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Reviewed LocusFounder fal model ID. Includes FLUX Schnell, Qwen Image 2, Gemini image editing, Seedance, Veo, Grok Video, and Happy Horse. |
| `prompt` | string | No | Text prompt for generation |
| `image_url` | string | No | Input image URL (for image-to-image/video models) |
| `num_images` | number | No | Number of images to generate |
| `duration` | number | No | Whole video duration in seconds. Required for public x402 video jobs. |
| `resolution` | string | No | Model-specific output resolution. |
| `webhook_url` | string | No | Optional HTTPS callback URL invoked by fal when the queued job completes. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/fal/generate \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","prompt":"<string>","image_url":"<string>","num_images":"<number>","duration":"<number>","resolution":"<string>","webhook_url":"<string>"}'
```

### Status

Check the status of a queued generation request.

**Estimated cost:** $0.003

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | No | Model ID used for the request. Required with request_id. |
| `request_id` | string | No | Request ID from the generate call. Required with model. |
| `status_url` | string | No | Canonical queue.fal.run status URL returned by the generate endpoint. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/fal/status \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","request_id":"<string>","status_url":"<string>"}'
```

### Result

Retrieve the output of a completed generation request.

**Estimated cost:** $0.003

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | No | Model ID used for the request. Required with request_id. |
| `request_id` | string | No | Request ID from the generate call. Required with model. |
| `result_url` | string | No | Canonical queue.fal.run response URL returned by the generate endpoint. response_url is also accepted as an alias. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/fal/result \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"<string>","request_id":"<string>","result_url":"<string>"}'
```
