·n8n Integration

n8n Integration

Generate AI images inside your n8n workflows using HTTP Request nodes. The API responds synchronously — no polling needed.

How it works

  1. Node 1 — POST to generate endpoint → response has image_url immediately
  2. Node 2 — Use image_url to download, send via email, upload to S3, etc.
1

Submit the image generation

Add an HTTP Request node with the configuration below.

FieldValue
MethodPOST
URLhttps://api.apinanobanana.com/v1/images/generate
AuthHeader → Authorization: Bearer nb_sk_...
BodyJSON (see code panel →)

The response comes back immediately with image_url and image_base64.

2

Use the image URL

Use {{ $json.image_url }} in subsequent nodes to:

  • Download and save to disk or cloud storage
  • Send as an email attachment
  • Post to Slack, Discord, or Telegram
  • Store URL in a database or Airtable

Image-to-image

To edit an existing image, add image_url pointing to your source image in the request body. The URL must be publicly accessible.

Check credit balance

Add a GET node before your generation to verify sufficient credits:

FieldValue
MethodGET
URLhttps://api.apinanobanana.com/v1/account/credits
AuthHeader → Authorization: Bearer nb_sk_...