Fal AI
Fal AI — Platform Guide
Platform — Fal AI

Fal AI webhooks,
the right way.

Fal AI uses Ed25519 public key cryptography — not HMAC. Tern handles it automatically. Pass an empty string for secret — it's intentional.

Fal AI uses Ed25519 — not HMAC
Unlike Stripe or Clerk which use HMAC-SHA256, Fal AI signs webhooks with Ed25519 public key cryptography. Tern automatically fetches Fal's public JWKS to verify signatures — you don't supply a secret.

Pass secret: "" (empty string). This is intentional, not a mistake.

Three lines.
Fully verified.

app/api/webhooks/route.ts
import { createWebhookHandler } from '@hookflo/tern/nextjs'
export const POST = createWebhookHandler({
platform: 'falai',
secret: '', // ← intentional empty string — see below
handler: async (payload) => {
console.log('Fal AI event:', payload)
return { received: true }
}
})

Two webhooks
per request.

Fal sends two webhooks per prediction. You can filter to completed only using the fal_webhook_events query parameter.

1
IN_QUEUE
{ status: 'IN_QUEUE', request_id: '...' }
immediate
↓ model runs...
2
COMPLETED
{ status: 'COMPLETED', output: { images: [...] } }
when done

Cheapest model
for testing.

fal-ai/flux/schnell — $0.003 per image
Use for testing. Not production quality — Schnell is 4-step, optimized for speed over quality.

Use ngrok or tunnel to expose your local server. Then trigger a prediction with your webhook URL as the fal_webhook query parameter.

What you need.

# your Fal AI API key
FAL_KEY=fal_xxx
 
# no WEBHOOK_SECRET needed — Fal uses Ed25519
# Tern fetches Fal's public JWKS automatically

Fal AI webhooks,
verified and reliable.

Open source · MIT licensed · Built at Hookflo