How to hit the fal.ai API

fal.ai runs generative media models. Requests go to a queue at https://queue.fal.run/<model>; you get a request_id, poll its status, then fetch the result.

Authentication

Create a key in the fal dashboard and send it as Authorization: Key <key> — the word Key, not Bearer. In the examples it's written {{FAL_KEY}}.

Full reference: https://fal.ai/docs/model-apis/model-endpoints/queue

Submit a request

curl -X POST https://queue.fal.run/fal-ai/flux/schnell \
  -H "Authorization: Key {{FAL_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a sunset over mountains"}'
Run in PostTaco

Check status

Status and result use the app id (fal-ai/flux), not the full model path — the submit response also gives you status_url and response_url. IN_QUEUE, IN_PROGRESS, then COMPLETED.

curl "https://queue.fal.run/fal-ai/flux/requests/{{REQUEST_ID}}/status?logs=1" \
  -H "Authorization: Key {{FAL_KEY}}"
Run in PostTaco

Get the result

curl https://queue.fal.run/fal-ai/flux/requests/{{REQUEST_ID}} \
  -H "Authorization: Key {{FAL_KEY}}"
Run in PostTaco