Skip to main content
Uploading an image to Prompt Bank is a two-step process. First, you call this endpoint to request a short-lived signed upload URL and receive back a permanent asset URL. Second, you PUT the raw file bytes directly to that signed URL. Once the upload completes, the permanent URL is ready to use in any API call that accepts an image — such as the imageUrl field on a prompt or the imageInput field on a generation. This design keeps large binary data out of Prompt Bank’s servers and delivers your file straight to storage with minimal latency.

Endpoint

Required scope: prompts:write

Step 1 — Request a signed upload URL

Call this endpoint with the content type and byte size of the file you intend to upload. Prompt Bank validates the parameters, provisions a storage slot, and returns a signed URL that authorises a single upload of exactly that file.

Request Body

string
required
The MIME type of the image you are uploading. Accepted values:
  • image/png
  • image/jpeg
  • image/webp
  • image/gif
integer
required
The exact byte size of the file. Must be between 1 and 10485760 (10 MB). The signed URL is scoped to this exact size; uploading a file of a different size will be rejected by storage.

Example request

Response — 201 Created


Step 2 — Upload the file bytes

PUT your raw file bytes to the uploadUrl from Step 1. Include the token as a Bearer token in the Authorization header and set Content-Type to match the contentType you declared in Step 1.
A successful upload returns an HTTP 200 with an empty body. No additional call to Prompt Bank is required — the asset is live at the permanent url as soon as storage confirms the upload.

Step 3 — Use the permanent URL

Use the url field (not uploadUrl) anywhere the Prompt Bank API accepts an image URI. For example:
The uploadUrl expires 2 hours (7,200 seconds) after it is issued. If your upload does not complete within that window, request a new signed URL by calling this endpoint again. The permanent url does not expire.
Always use the url field — the permanent asset URL — in subsequent API calls. The uploadUrl is a one-time write credential for storage and will not serve your image to Prompt Bank or fal.ai. Passing uploadUrl as an imageInput will result in an authentication error from storage.