Saltar al contenido
Documentación:Files

APIs

Files

Upload an image, a video or an audio file to use as a task input, and how long input and result files are kept.

Esta página aún no está traducida. Se muestra la versión en inglés.

Some models take media as input: reference images of the people, objects or styles a result should keep. An input is always passed as a URL. If your file is already reachable at a public https URL, pass that URL. If it is not, upload it to Minu first and pass the URL you get back.

Upload a file

POST /v1/files with a multipart form. The file goes in a field named file.

curl https://api.minu.ai/v1/files \
  -H "Authorization: Bearer $MINU_API_KEY" \
  -F file=@product.jpg

Do not set the Content-Type header yourself: your HTTP client adds the multipart boundary.

JSON
{
  "id": "file_1k8r2m4p0d3f5h7k9m1p3r5t",
  "object": "file",
  "url": "https://…",
  "mime": "image/jpeg",
  "bytes": 482113,
  "expires_at": 1797379200
}
FieldDescription
idIdentifier of the file, starting with file_.
urlThe URL to pass in a task input.
mimeMedia type, detected from the file's content.
bytesSize of the file.
expires_atWhen the file is deleted, in Unix seconds.

Limits

  • One file per request, in the field file.
  • 30 MB at most. A larger file is refused with 413 file_too_large.
  • Images, video and audio only. The type is decided by the content of the file, not by its name or the type your client declares. Anything else is refused with 400 unsupported_media.

Use the file in a task

Put the url where the model expects media. The parameter name depends on the model; the model reference lists each model's parameters.

Shell
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": "Put this product on a marble kitchen counter, morning light",
      "image_urls": ["https://…"]
    }
  }'

URLs you supply yourself, for inputs and for callback_url, must be https and publicly reachable. A URL that is not gets 400 url_not_allowed.

How long files are kept

  • Uploaded inputs are deleted at expires_at, which is your organization's retention period after the upload.
  • Result files of tasks are kept for the same retention period after the task ends.

The retention period is 14 days by default. An owner or an admin can set it between 1 and 30 days in the console, under Settings. A change applies to files stored from then on.

Once a file is deleted, its URL stops working. Copy the results you want to keep into your own storage, ideally as soon as the task ends.