Skip to Content
AgentsTask guidesSave an image

Save an Image

Getting an image into Gavana is not generation. Nothing is sent to an AI provider and no credits are spent — but it does write to the canvas, so it needs approval like any other write.

There are two routes, and they produce different things.

RouteSourceProducesScopes
ImportA public HTTPS URL, an image already uploaded to Gavana (asset:), a local file (local MCP), or a file your chat client hands overA durable image node on a canvas, plus an assetcanvas:read, canvas:write, asset:read, image:generate
UploadA local file, stdin, or the macOS clipboardA durable asset in your library, reusable as a reference or inputasset:read plus image:generate or video:generate

Import when the image should appear on the board. Upload when you need a handle to feed into an Action, an image edit, a Recipe, or a video frame — and import that handle afterwards if it should also appear on the board.

Import requires the image:generate scope even though it generates nothing — the scope gates the image pipeline as a whole, not generation specifically. Plan for that when scoping a token whose job is only to file images.

Before either route: one task canvas

Every import names an exact canvas. If the task does not have one yet, create it once and keep the handle:

TASK_CANVAS=$(gavana canvas create --title "Hero renders" \ --idempotency-key "hero-renders-task-20261005" --jq '.canvas.handle' -r)

Over MCP the same step is canvas_create. There is no shared default canvas to fall back on.

Route A — Import onto a canvas

Call sequence

canvas_get → save_image_to_canvas → canvas_get (verify)

Read the destination canvas

gavana canvas get "$TASK_CANVAS" --jq '.canvas.revision' -r

Check. Note the revision and the current visible bounds. New work goes outside the existing bounding box — to the right with at least 160 units of spacing, or below with the same spacing.

Import the image

Hosted MCP: call save_image_to_canvas with the canvas handle as destination, exactly one source, and a caller-stable idempotencyKey:

Source fieldUse it for
imageUrlA public HTTPS image
assetIdAn image already uploaded to Gavana — for example from gavana asset upload
imageA file your chat client hands over directly (ChatGPT does)
productPageUrlA product page; imports its verified gallery images instead of one image — see below

Local MCP: call canvas_image_save with canvasId, exactly one of filePath (a local image the user supplied), assetId, or imageUrl, and an idempotencyKey. A filePath is uploaded first and then imported by its new asset handle.

Both tools take title, x, y, and background. Set background: "transparent" whenever the user asked for the background removed: Gavana then refuses an opaque, coloured, or painted-checkerboard image instead of placing it.

CLI, through the raw passthrough — there is no dedicated image import command:

gavana api POST /images/import --json '{ "canvasId": "canvas:OWNER_UID:CANVAS_ID", "imageUrl": "https://example.com/render.png", "title": "Hero render v3", "idempotencyKey": "import-hero-v3-2026-10-05", "x": 1600, "y": 240 }'
FieldNotes
canvasIdA plain id, or a canvas: handle. Required
imageUrlMust be https://, at most 4,096 characters
idempotencyKey8–200 characters. Required
sourceIdOptional stable source identity, such as a ChatGPT file_id. When present Gavana matches idempotent retries on it rather than on an expiring download URL
titleUp to 160 characters; defaults to Image from ChatGPT
x, yPosition, from −100,000 to 100,000

The server also accepts assetId in place of imageUrl, and background, as the MCP tools do; the published OpenAPI document does not list those two fields yet. Send one source, never both.

Gavana downloads a URL through an SSRF-safe fetcher that rejects private and local-network destinations, stores the picture as a canvas-scoped asset, and adds one deterministic image node.

If the image URL expires — as chat-client download URLs usually do — a later retry with the same idempotency key may not be able to fetch it again. Pass sourceId so Gavana can match the retry on stable identity instead of on the URL.

Verify

The response is your verification. It returns:

status "succeeded" replayed true when this was an idempotent replay, not a new import canvasId canvas:… canvasRevision the new revision canvasUrl a review link for a human image.assetId asset:… ← durable image.nodeId node:… ← durable image.mediaType, width, height, bytes image.previewUrl, image.markdown

Check. replayed: true means you already did this — no duplicate was created. That is the idempotency key working, not a failure. The same key with a different image, title, or position is a conflict, not a replay.

Report the durable handles

Hand back image.nodeId, image.assetId, and canvasUrl. Do not hand back previewUrl as if it were durable — it is a scoped preview for review, not the record.

Product pages

When the user names a product by its page and wants pictures of it made, import the page first. save_image_to_canvas with productPageUrl (optionally one exact variantSelector, or the exact imageUrls you identified) imports the page’s verified gallery images into one Product References Section and returns their node handles. When Gavana cannot prove the product or the variant, it returns review_required and writes nothing — do not generate that product without the references.

The imported images are references, not the result: look at them, then generate from their node handles. Over the API the same import is POST /product-references/import.

Route B — Upload a local file as an asset

Call sequence

asset upload → (use the returned asset: handle as an input, or import it)

Upload

gavana asset upload ./product.png --jq '.asset.handle' -r

Also accepted: --file PATH, - for stdin, and clipboard on macOS. Add --canvas "$TASK_CANVAS" to store the asset inside that canvas, which also needs canvas:read and canvas:write.

cat ./product.png | gavana asset upload - gavana asset upload clipboard

The file must be a PNG, JPEG, WebP, or GIF, and at most 50 MB. The CLI checks the magic bytes rather than the extension, and rejects an unsupported or empty file before sending anything.

Check. You now hold an asset: handle. It is not yet a node on any canvas. To place it, import it as in Route A with assetId.

Use it

The asset handle is now valid input anywhere Gavana takes an image reference:

# As a deterministic Action input — no AI credits gavana action run action:resize \ --input asset:ASSET_ID \ --destination "$TASK_CANVAS" \ --width 1080 --height 1350 # As the image to edit — paid, ask first gavana image edit \ --destination "$TASK_CANVAS" \ --source asset:ASSET_ID \ --prompt "Warm the lighting" # As a Recipe image-port input — paid, ask first gavana recipe run recipe:RECIPE_ID \ --input product-image=asset:ASSET_ID \ --destination "$TASK_CANVAS" # As a video first frame — paid, ask first gavana video generate \ --model model:OPAQUE_MODEL_KEY \ --prompt "A slow turntable" \ --first-frame asset:ASSET_ID

An Action run on an existing handle costs no AI credits and lands a real node on the canvas. action:remove-background is the free way to turn a flat or checkerboard background into real transparency.

The shortcut

Every image, Action, and Recipe command accepts a local path directly and uploads it for you:

gavana action run action:resize --input ./product.png --destination "$TASK_CANVAS" --width 1080 --height 1350

Upload separately when the same file is used more than once — one upload, one handle, reused. Within a single command the CLI already deduplicates identical files by content hash.

What you end up with

RouteDurable output
Importnode: on the canvas, asset:, a new canvas revision, and a review link
Uploadasset: in your library (or in the canvas you named), reusable across commands

Both are durable. The previewUrl on an import response is not — treat it as a review aid only, and never paste it anywhere a credential should not go.

Common mistakes

MistakeWhat happens
Writing an image URL into a node’s metadata.contentRejected. Text content on an image node is not allowed — import, or use a generation operation
Uploading a file and expecting it on the canvasYou get an asset, not a node. Import it with assetId, or run an Action, to place it
Passing both imageUrl and assetIdRejected: an import takes one source
Reusing an idempotency key for a different imageA conflict, or the first result back. New image, new key
Importing from a private or internal URLRejected by the SSRF-safe fetcher
Importing a cut-out with background left on autoAn opaque result is accepted. Ask for transparent when transparency was the point
Sharing previewUrl as the deliverableIt is scoped and temporary. Share the node: and asset: handles
Last updated on