رفتن به محتوا
مستندات:Migrating from fal

راهنماها

Migrating from fal

Map an integration written for fal's queue API onto Minu's Task API. Each call and its equivalent, the result and the webhook, and what has no equivalent.

این صفحه هنوز ترجمه نشده است. نسخه انگلیسی نمایش داده می‌شود.

Minu does not serve fal's routes and does not work with fal's client libraries. Moving an integration over means rewriting the few calls that talk to the API: submit, status, result and the webhook handler. This page maps each of them onto Minu's Task API and says, just as plainly, what has no equivalent.

What this page says about fal's API is taken from fal's public documentation as it stood on 3 December 2026.

At a glance

falMinu
Base URLhttps://queue.fal.runhttps://api.minu.ai
KeyAuthorization: Key $FAL_KEYAuthorization: Bearer $MINU_API_KEY
Which modelIn the URL: POST /{owner}/{app}In the body: "model"
The model's parametersThe JSON body itselfThe input object of the body
SubmitPOST /{owner}/{app}POST /v1/tasks
ID of the requestrequest_idid, starting with task_
StatusGET /{owner}/{app}/requests/{request_id}/statusGET /v1/tasks/{id}
ResultGET /{owner}/{app}/requests/{request_id}The same call: outputs on the task
CancelPUT /{owner}/{app}/requests/{request_id}/cancelPOST /v1/tasks/{id}/cancel
WebhookThe query parameter fal_webhookcallback_url in the body, or an endpoint set up in the console
Upload a filefal.storage.upload, fal_client.upload_filePOST /v1/files
Client library@fal-ai/client, fal-clientNone. Plain HTTP

Before you switch

  1. Create a Minu account, top up, and create an API key. Minu bills in US dollars from a prepaid balance and charges a task for the results it delivered.
  2. Check that the models you use are in the catalog, and compare their parameters with the ones you send today. The model reference lists them.
  3. If you receive webhooks, create a signing secret in the console under Webhooks.

Submit a request

The model moves from the URL into the body, and the parameters move one level down, into input:

Shell
# Before
curl -X POST https://queue.fal.run/fal-ai/nano-banana-2 \
  -H "Authorization: Key $FAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "A paper boat on a rain puddle", "aspect_ratio": "16:9" }'

# After
curl https://api.minu.ai/v1/tasks \
  -H "Authorization: Bearer $MINU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/nano-banana-2",
    "input": { "prompt": "A paper boat on a rain puddle", "aspect_ratio": "16:9" }
  }'

fal answers with request_id and three URLs: status_url, response_url and cancel_url. Minu answers with the task object: its id, "status": "queued" and estimated_cost_usd, the amount reserved for it. There are no URLs to store; every later call is built from the id.

Two things to know when you rewrite this call:

  • The request is checked before it is accepted. A parameter the model does not list, or a value it does not take, is refused at once with 400 invalid_request, and param names the field. Nothing is ignored silently.
  • A retry can be made safe. Send an Idempotency-Key header and a repeated request returns the task you already created.

In place of subscribe

fal.subscribe and fal_client.subscribe submit a request and wait for its result. Minu has no client library, so that becomes a small function of your own: create the task, read it until its status is final, return it.

const API = 'https://api.minu.ai';
const headers = {
  Authorization: `Bearer ${process.env.MINU_API_KEY}`,
  'Content-Type': 'application/json',
};
const FINAL = new Set(['succeeded', 'partially_succeeded', 'failed', 'canceled', 'expired']);

async function call(path, init) {
  const response = await fetch(`${API}${path}`, { ...init, headers });
  const body = await response.json();
  if (!response.ok) throw new Error(`${response.status} ${body.error?.code}: ${body.error?.message}`);
  return body;
}

/** Creates a task, waits for it to end and returns it. */
export async function runTask(model, input) {
  let task = await call('/v1/tasks', { method: 'POST', body: JSON.stringify({ model, input }) });
  while (!FINAL.has(task.status)) {
    await new Promise((resolve) => setTimeout(resolve, 3000));
    task = await call(`/v1/tasks/${task.id}`);
  }
  if (task.outputs.length === 0) throw new Error(`${task.status} ${task.error?.code}: ${task.error?.message}`);
  return task;
}

// Before:
//   const result = await fal.subscribe('fal-ai/nano-banana-2', { input: { prompt } });
//   const url = result.data.images[0].url;
const task = await runTask('google/nano-banana-2', { prompt: 'A paper boat on a rain puddle' });
const url = task.outputs[0].url;

Every read of a task counts against the rate limit of 20 requests per 10 seconds. With many tasks in flight, use a webhook instead of a loop.

Status

One call returns both the status and, once the task has ended, the result. There is no separate result URL.

fal statusMinu status
IN_QUEUEqueued
IN_PROGRESSrunning, finalizing
COMPLETED, without errorsucceeded, partially_succeeded
COMPLETED, with errorfailed, expired
A canceled requestcanceled

At fal, COMPLETED covers a request that failed, and the error field tells the two apart. At Minu the status itself says how the task ended, and error holds a code and a message when it did not succeed. Write the loop against the five final statuses, as the function above does: the API can report other in-progress values, such as preparing.

partially_succeeded has no counterpart at fal. It means that some of the results you asked for were delivered, for example three images of four, and that you are charged for those only.

The result

At fal the shape of the result depends on the model: an image model returns images, a video model returns video. At Minu every task model returns the same list, outputs:

JSON
"outputs": [
  { "index": 0, "type": "image", "url": "https://…", "mime": "image/png", "bytes": 1482113 }
]
falMinu
images[0].urloutputs[0].url
video.urloutputs[0].url
content_typemime
file_sizebytes
file_name, width, heightNot part of an output. Read them from the file.

Result files are served from Minu's storage and are kept for 14 days by default; an owner or an admin can set the period between 1 and 30 days in the console. Copy what you need to keep.

Model IDs and parameters

fal addresses a model by an endpoint ID in the URL, and often gives one model several endpoints: one to generate, one to edit, one for text to video, one for image to video. At Minu a model has one ID. Whether a request generates or edits is decided by what you send: reference images go in image_urls on the same model.

These are the fal endpoints of three image models and the Minu model that takes their place:

fal endpointMinu model
fal-ai/nano-banana-2, fal-ai/nano-banana-2/editgoogle/nano-banana-2
fal-ai/nano-banana-pro, fal-ai/nano-banana-pro/editgoogle/nano-banana-pro
openai/gpt-image-2, openai/gpt-image-2/editopenai/gpt-image-2

For every other model, look it up in the catalog. A model that is not there cannot be called.

Parameter names are often the same, but each model's list is its own. The common ones:

fal parameterAt Minu
promptprompt
image_urls on an /edit endpointimage_urls on the model itself
num_imagesn, on the models that list it. On the others, create one task per image.
aspect_ratioaspect_ratio, with the values the model lists
image_size, as a name such as landscape_4_3 or as a width and a heightaspect_ratio and resolution
resolutionresolution, on the models that list it
output_formatoutput_format, on the models that list it
seedseed, on the models that list it
duration as a string, such as "8"duration as a number of seconds
generate_audiogenerate_audio, on the models that list it
quality, sync_mode, safety_tolerance, enable_web_searchNo equivalent. Leave them out.

Files

At fal you upload a local file with fal.storage.upload or fal_client.upload_file and pass the URL you get back. Minu works the same way with one HTTP call: POST /v1/files with a multipart form returns a url to put in the task's input.

Shell
curl https://api.minu.ai/v1/files \
  -H "Authorization: Bearer $MINU_API_KEY" \
  -F file=@product.jpg
  • A file that is already at a public https URL needs no upload. Pass that URL.
  • An upload is one file of at most 30 MB: an image, a video or an audio file.
  • An input is always an https URL. A data: URI is refused.

Webhooks

At fal the webhook URL is the query parameter fal_webhook of the submit call. At Minu it is the field callback_url in the body of POST /v1/tasks. You can also set up an endpoint once in the console and receive the events of every task; see Webhooks.

The delivery has another shape:

fal deliveryMinu delivery
request_iddata.id
status: "OK"type: "task.succeeded" or "task.partially_succeeded"
status: "ERROR"type: "task.failed", "task.expired" or "task.canceled"
payload, the model's resultdata.outputs; data is the whole task object
errordata.error.code and data.error.message

The signature changes as well, so the verification code has to be replaced, not adjusted:

falMinu
HeadersX-Fal-Webhook-Request-Id, X-Fal-Webhook-User-Id, X-Fal-Webhook-Timestamp, X-Fal-Webhook-Signatureminu-webhook-id, minu-webhook-timestamp, minu-signature
SignatureEd25519, checked against public keys fetched from falHMAC-SHA256 with your organization's signing secret
Signed textThe request ID, the user ID, the timestamp and the SHA-256 of the bodyid.timestamp.body

Verify the signature has the code for Node.js and Python. Answer each delivery with a 2xx status within 10 seconds. One that fails is retried on a fixed schedule: eight attempts over about 33 hours.

Errors

Minu uses HTTP statuses with one error shape, { "error": { "code", "message", "param" } }. Branch on code. The full list is in Errors and rate limits.

At falAt Minu
422 with a detail list of loc, msg and type400 invalid_request. param names the field.
422 with the type content_policy_violation400 content_blocked on the request, or a task that ends failed with the error code content_blocked. Not charged.
401401 invalid_api_key or key_revoked
403403 model_not_allowed, ip_not_allowed or organization_suspended
A request that failed while running: COMPLETED with errorA task that ends failed or expired. Not charged.

Three answers your code may not handle yet:

  • 402 insufficient_balance: the available balance does not cover the task. No task is created.
  • 429 rate_limited: more than 20 requests in 10 seconds. The Retry-After header says how long to wait.
  • 429 queue_full: tasks beyond your concurrency limit wait in a queue, as they do at fal, but the queue is bounded. When too many of your tasks are waiting, new ones are refused until some have ended.

What has no equivalent

At falAt Minu
The client libraries @fal-ai/client and fal-clientNone. You call the HTTP API directly, as on this page.
Synchronous requests: fal.run, https://fal.run/…Not offered for images, video and music. Every generation is a task. Chat, transcription and speech are synchronous, through the OpenAI-compatible API.
Streaming: the status stream, fal.streamNot offered. Poll the task or use a webhook.
queue_position, logs, metricsNot returned. A task has created_at, started_at and completed_at.
A first frame for a video: image_url and end_image_url on an image-to-video endpointNo equivalent. Images sent with a video request are reference images of people or objects the video should keep, not its first or last frame.
Canceling a request that is runningOnly a task that is still queued can be canceled. Once started, it runs to its end, and the call answers 409 not_cancelable.
Inputs as data: URIsRefused. Upload the file, or pass an https URL.
The headers X-Fal-Store-IO and X-Fal-Object-Lifecycle-PreferenceIgnored. How long files are kept is a setting of the organization, in the console.
Your own models and apps, and compute by the hourNot offered. Minu serves the models in its catalog.
Models that are not in Minu's catalogRefused with 404 model_not_found.

Check your migration

  1. Create one task per model you use, with a real prompt and the parameters your application sends.
  2. Read each task until it ends, and confirm that your code finds the files in outputs.
  3. Send a request you expect to be refused, such as an aspect ratio the model does not list, and confirm that your code reads error.code.
  4. If you use webhooks, confirm that a delivery arrives and that your signature check passes with the Minu signing secret.
  5. Open Logs in the console and check the cost of each task. It is on the task as well, as cost_usd.