Skip to Content
DocumentationFiles and media URLs

Files and media URLs

Media inputs are URLs inside a model’s input object. Use public HTTPS URLs that the upstream provider can fetch without cookies, authorization headers, or an interactive login.

{ "model": "nano-banana-2", "input": { "prompt": "Replace the background with a clean studio wall", "imageUrls": ["https://cdn.example.com/source.png"] } }

The exact field name and maximum number of files vary by model. Use that model’s parameter table rather than assuming a media field is universal.

Input checklist

  • Return the file body directly, not an HTML preview page.
  • Keep the URL reachable for the entire generation.
  • Use the media type and size accepted by the selected model.
  • Avoid short-lived signed URLs unless their expiry exceeds processing time.

Generated files

Successful media tasks return API Stock storage URLs in data.files:

{ "files": [ { "fileUrl": "https://storage.api-stock.com/generated/result.png", "fileType": "image" } ] }

Download results after the task becomes finished and copy permanent assets to storage you control. Treat these as delivery URLs, not an archive contract.