PierNode
ExamplesDemo

Transform an Image

Browse published image effects and the request that runs each one.

Browse image transformation effects. Open one to preview the result and see how to call it with effectId.

Using an effect

Same endpoint, different effectId, different effect. The instruction behind one is PierNode's — you name the effect and it is applied to the image you uploaded.

# 1. reserve — the response carries the id and the URL to send the bytes to
ASSET=$(curl -s -X POST https://app.piernode.com/api/v1/uploads \
  -H "Authorization: Bearer $PIERNODE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png"}')
ASSET_ID=$(echo "$ASSET" | jq -r .id)
UPLOAD_URL=$(echo "$ASSET" | jq -r .uploadUrl)

# 2. send the bytes, then verify them
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/png" --data-binary @photo.png
curl -X POST https://app.piernode.com/api/v1/uploads/$ASSET_ID/complete \
  -H "Authorization: Bearer $PIERNODE_API_KEY"

$ASSET_ID is what the transformation sends as assetId:

curl -X POST https://app.piernode.com/api/v1/images/transformations \
  -H "Authorization: Bearer $PIERNODE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "assetId": "<asset-id>",
    "effectId": "<effect-id>"
  }'

That returns a task. Poll it for the result.

FieldRole
assetIdWhich image. Reuse one across as many effects as you like.
effectIdWhat happens. Optional here — see below.
resolutionhd or fhd. Sets the price.
aspectRatioOptional; defaults to the image's own shape.

An effect may preset resolution or aspectRatio, and anything you send yourself wins over it. The card for each effect lists what it presets.

Or write the prompt yourself

effectId is optional on this endpoint. Leaving it out and sending a prompt is the ordinary transform request, and the two can be combined: a prompt alongside an effectId is added to the effect's own instruction rather than replacing it.

Uploading is free and an asset does not expire, so exploring costs one upload and one generation per attempt.

See also