Meldport
google · Image

Nano Banana 2 API

Image model · Published on Meldport

Nano Banana 2 is available through Meldport for text to image, image to image. These examples use Meldport's image API and a Meldport workspace key. Quote the selected configuration, submit a job with the images:generate scope, poll until it succeeds and billing is settled, then request a download URL.

Generation is available through the published Meldport configurations below. Review the exact quote before submitting.

Model ID
google-nano-banana-2
Released
Feb 26, 2026
Billing unit
generation

Choose a Nano Banana 2 configuration

Choose the workflow first: generate from a text prompt or edit an uploaded image. Then compare output sizes within that workflow. A price for one size does not apply to every Nano Banana 2 configuration.

Published workflows, output settings and rates for Nano Banana 2
WorkflowOutput settingsRateIntegration
text to image2K · 1 output · 2048 × 2048 px
Estimated totalMeldport $0.12306/ generation
Request and parameters
text to image4K · 1 output · 4096 × 4096 px
Estimated totalMeldport $0.18354/ generation
Request and parameters
text to image1K · 1 output · 1024 × 1024 px
Estimated totalMeldport $0.08274/ generation
Request and parameters
image to image2K · 1 output
Estimated totalMeldport $0.123396/ generation
Request and parameters
image to image1K · 1 output
Estimated totalMeldport $0.083076/ generation
Request and parameters
image to image4K · 1 output
Estimated totalMeldport $0.183876/ generation
Request and parameters

Each row is a separate published configuration. Estimated rates can differ from the final charge; request a quote for the exact configuration before creating a paid job.

Follow the image API quickstart

MODEL API

How to call the Nano Banana 2 API

Nano Banana 2 is available through Meldport for text to image, image to image. These examples use Meldport's image API and a Meldport workspace key. Quote the selected configuration, submit a job with the images:generate scope, poll until it succeeds and billing is settled, then request a download URL.

API scope
images:generate
Quote endpoint
POST /v1/media/quotes
Job endpoint
POST /v1/media/jobs
Poll endpoint
GET /v1/media/jobs/{job_id}
Download endpoint
POST /v1/media/jobs/{job_id}/download-url
Published configurations
6
Starting rate
Estimated $0.082740 per generation
Workflows
Text to image · Image to image
Output formats
image/jpeg
Published output sizes
1K · 2K · 4K · 1024 × 1024 px · 2048 × 2048 px · 4096 × 4096 px
Output retention
8 days

Generation requests use a published configuration ID. The quote returns the customer price and maximum reservation before a paid job starts.

Meldport generation prices

text to image · 2K · 1 output · 2048 × 2048 px

API configuration ID37c79f27-523b-4c9d-bea2-c855dbd4bcb6

text to image

Estimated totalMeldport $0.12306/ generation

2K · 1 output. Final cost may differ from the estimate. See billing details.

Variable billing details
API request and parameters

Use images:generate on your API key. This configuration runs text to image and returns image/jpeg.

This configuration does not require an uploaded image. Choose a different configuration ID to change the workflow or output settings. Send only options listed below.

These output settings are included in this configuration. Select another configuration ID to change them. Do not add them to options.

generation_parametersJSON
{
  "width": 2048,
  "height": 2048
}

This configuration has no additional request options.

Replace the prompt and set a unique MELDPORT_IDEMPOTENCY_KEY for this operation. The example quotes the request and then creates one paid job. Read the billing rules before accepting variable charges.

generate.mjsJavaScript
const api = "https://api.meldport.com";
const key = process.env.MELDPORT_API_KEY;
const idempotencyKey = process.env.MELDPORT_IDEMPOTENCY_KEY;
if (!key || !idempotencyKey) throw new Error("Set your API key and a unique operation ID first.");

async function post(path, body) {
  const response = await fetch(api + path, {method: "POST",
    headers: {Authorization: `Bearer ${key}`, "Content-Type": "application/json"},
    body: JSON.stringify(body)});
  const result = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(result.error));
  return result;
}

const request = {
  "configuration_id": "37c79f27-523b-4c9d-bea2-c855dbd4bcb6",
  "prompt": "Replace with your prompt or speech script.",
  "options": {},
  "input_asset_ids": []
};
const {data: quote} = await post("/v1/media/quotes", request);
console.log("Quote:", quote);
const result = await post("/v1/media/jobs", {
  ...request, idempotency_key: idempotencyKey,
  accepted_customer_price_microusd: quote.customer_price_microusd,
  accepted_maximum_reservation_microusd: quote.maximum_reservation_microusd,
  ...(quote.billing_policy_version === "actual-cost-v1"
    ? {billing_policy_version: "actual-cost-v1"} : {}),
});
console.log(result.job);
// Poll GET /v1/media/jobs/<job.id> with the same API key.
// Keep this operation ID for retries. A new ID requests another generation.

Poll the returned job ID. Download only after state is succeeded and billing_state is settled. Polling and download example.

text to image · 4K · 1 output · 4096 × 4096 px

API configuration ID889b587a-b0c1-4165-b592-8f61d047ef41

text to image

Estimated totalMeldport $0.18354/ generation

4K · 1 output. Final cost may differ from the estimate. See billing details.

Variable billing details
API request and parameters

Use images:generate on your API key. This configuration runs text to image and returns image/jpeg.

This configuration does not require an uploaded image. Choose a different configuration ID to change the workflow or output settings. Send only options listed below.

These output settings are included in this configuration. Select another configuration ID to change them. Do not add them to options.

generation_parametersJSON
{
  "width": 4096,
  "height": 4096
}

This configuration has no additional request options.

Replace the prompt and set a unique MELDPORT_IDEMPOTENCY_KEY for this operation. The example quotes the request and then creates one paid job. Read the billing rules before accepting variable charges.

generate.mjsJavaScript
const api = "https://api.meldport.com";
const key = process.env.MELDPORT_API_KEY;
const idempotencyKey = process.env.MELDPORT_IDEMPOTENCY_KEY;
if (!key || !idempotencyKey) throw new Error("Set your API key and a unique operation ID first.");

async function post(path, body) {
  const response = await fetch(api + path, {method: "POST",
    headers: {Authorization: `Bearer ${key}`, "Content-Type": "application/json"},
    body: JSON.stringify(body)});
  const result = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(result.error));
  return result;
}

const request = {
  "configuration_id": "889b587a-b0c1-4165-b592-8f61d047ef41",
  "prompt": "Replace with your prompt or speech script.",
  "options": {},
  "input_asset_ids": []
};
const {data: quote} = await post("/v1/media/quotes", request);
console.log("Quote:", quote);
const result = await post("/v1/media/jobs", {
  ...request, idempotency_key: idempotencyKey,
  accepted_customer_price_microusd: quote.customer_price_microusd,
  accepted_maximum_reservation_microusd: quote.maximum_reservation_microusd,
  ...(quote.billing_policy_version === "actual-cost-v1"
    ? {billing_policy_version: "actual-cost-v1"} : {}),
});
console.log(result.job);
// Poll GET /v1/media/jobs/<job.id> with the same API key.
// Keep this operation ID for retries. A new ID requests another generation.

Poll the returned job ID. Download only after state is succeeded and billing_state is settled. Polling and download example.

text to image · 1K · 1 output · 1024 × 1024 px

API configuration IDb8c670f7-f51a-4a2a-9f6f-3ff90b10b0a1

text to image

Estimated totalMeldport $0.08274/ generation

1K · 1 output. Final cost may differ from the estimate. See billing details.

Variable billing details
API request and parameters

Use images:generate on your API key. This configuration runs text to image and returns image/jpeg.

This configuration does not require an uploaded image. Choose a different configuration ID to change the workflow or output settings. Send only options listed below.

These output settings are included in this configuration. Select another configuration ID to change them. Do not add them to options.

generation_parametersJSON
{
  "width": 1024,
  "height": 1024
}

This configuration has no additional request options.

Replace the prompt and set a unique MELDPORT_IDEMPOTENCY_KEY for this operation. The example quotes the request and then creates one paid job. Read the billing rules before accepting variable charges.

generate.mjsJavaScript
const api = "https://api.meldport.com";
const key = process.env.MELDPORT_API_KEY;
const idempotencyKey = process.env.MELDPORT_IDEMPOTENCY_KEY;
if (!key || !idempotencyKey) throw new Error("Set your API key and a unique operation ID first.");

async function post(path, body) {
  const response = await fetch(api + path, {method: "POST",
    headers: {Authorization: `Bearer ${key}`, "Content-Type": "application/json"},
    body: JSON.stringify(body)});
  const result = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(result.error));
  return result;
}

const request = {
  "configuration_id": "b8c670f7-f51a-4a2a-9f6f-3ff90b10b0a1",
  "prompt": "Replace with your prompt or speech script.",
  "options": {},
  "input_asset_ids": []
};
const {data: quote} = await post("/v1/media/quotes", request);
console.log("Quote:", quote);
const result = await post("/v1/media/jobs", {
  ...request, idempotency_key: idempotencyKey,
  accepted_customer_price_microusd: quote.customer_price_microusd,
  accepted_maximum_reservation_microusd: quote.maximum_reservation_microusd,
  ...(quote.billing_policy_version === "actual-cost-v1"
    ? {billing_policy_version: "actual-cost-v1"} : {}),
});
console.log(result.job);
// Poll GET /v1/media/jobs/<job.id> with the same API key.
// Keep this operation ID for retries. A new ID requests another generation.

Poll the returned job ID. Download only after state is succeeded and billing_state is settled. Polling and download example.

image to image · 2K · 1 output

API configuration ID931565d9-2776-4974-ad80-1eec27e83d4e

image to image

Estimated totalMeldport $0.123396/ generation

2K · 1 output. Final cost may differ from the estimate. See billing details.

Variable billing details
API request and parameters

Use images:generate on your API key. This configuration runs image to image and returns image/jpeg.

Upload an image using the same API key, then replace YOUR_UPLOADED_ASSET_ID. Input upload example. Choose a different configuration ID to change the workflow or output settings. Send only options listed below.

These output settings are included in this configuration. Select another configuration ID to change them. Do not add them to options.

generation_parametersJSON
{
  "resolution": "2K"
}

This configuration has no additional request options.

Replace the prompt and set a unique MELDPORT_IDEMPOTENCY_KEY for this operation. The example quotes the request and then creates one paid job. Read the billing rules before accepting variable charges.

generate.mjsJavaScript
const api = "https://api.meldport.com";
const key = process.env.MELDPORT_API_KEY;
const idempotencyKey = process.env.MELDPORT_IDEMPOTENCY_KEY;
if (!key || !idempotencyKey) throw new Error("Set your API key and a unique operation ID first.");

async function post(path, body) {
  const response = await fetch(api + path, {method: "POST",
    headers: {Authorization: `Bearer ${key}`, "Content-Type": "application/json"},
    body: JSON.stringify(body)});
  const result = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(result.error));
  return result;
}

const request = {
  "configuration_id": "931565d9-2776-4974-ad80-1eec27e83d4e",
  "prompt": "Replace with your prompt or speech script.",
  "options": {},
  "input_asset_ids": [
    "YOUR_UPLOADED_ASSET_ID"
  ]
};
const {data: quote} = await post("/v1/media/quotes", request);
console.log("Quote:", quote);
const result = await post("/v1/media/jobs", {
  ...request, idempotency_key: idempotencyKey,
  accepted_customer_price_microusd: quote.customer_price_microusd,
  accepted_maximum_reservation_microusd: quote.maximum_reservation_microusd,
  ...(quote.billing_policy_version === "actual-cost-v1"
    ? {billing_policy_version: "actual-cost-v1"} : {}),
});
console.log(result.job);
// Poll GET /v1/media/jobs/<job.id> with the same API key.
// Keep this operation ID for retries. A new ID requests another generation.

Poll the returned job ID. Download only after state is succeeded and billing_state is settled. Polling and download example.

image to image · 1K · 1 output

API configuration ID6c822edf-a676-4cd0-8717-8935c240c26a

image to image

Estimated totalMeldport $0.083076/ generation

1K · 1 output. Final cost may differ from the estimate. See billing details.

Variable billing details
API request and parameters

Use images:generate on your API key. This configuration runs image to image and returns image/jpeg.

Upload an image using the same API key, then replace YOUR_UPLOADED_ASSET_ID. Input upload example. Choose a different configuration ID to change the workflow or output settings. Send only options listed below.

These output settings are included in this configuration. Select another configuration ID to change them. Do not add them to options.

generation_parametersJSON
{
  "resolution": "1K"
}

This configuration has no additional request options.

Replace the prompt and set a unique MELDPORT_IDEMPOTENCY_KEY for this operation. The example quotes the request and then creates one paid job. Read the billing rules before accepting variable charges.

generate.mjsJavaScript
const api = "https://api.meldport.com";
const key = process.env.MELDPORT_API_KEY;
const idempotencyKey = process.env.MELDPORT_IDEMPOTENCY_KEY;
if (!key || !idempotencyKey) throw new Error("Set your API key and a unique operation ID first.");

async function post(path, body) {
  const response = await fetch(api + path, {method: "POST",
    headers: {Authorization: `Bearer ${key}`, "Content-Type": "application/json"},
    body: JSON.stringify(body)});
  const result = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(result.error));
  return result;
}

const request = {
  "configuration_id": "6c822edf-a676-4cd0-8717-8935c240c26a",
  "prompt": "Replace with your prompt or speech script.",
  "options": {},
  "input_asset_ids": [
    "YOUR_UPLOADED_ASSET_ID"
  ]
};
const {data: quote} = await post("/v1/media/quotes", request);
console.log("Quote:", quote);
const result = await post("/v1/media/jobs", {
  ...request, idempotency_key: idempotencyKey,
  accepted_customer_price_microusd: quote.customer_price_microusd,
  accepted_maximum_reservation_microusd: quote.maximum_reservation_microusd,
  ...(quote.billing_policy_version === "actual-cost-v1"
    ? {billing_policy_version: "actual-cost-v1"} : {}),
});
console.log(result.job);
// Poll GET /v1/media/jobs/<job.id> with the same API key.
// Keep this operation ID for retries. A new ID requests another generation.

Poll the returned job ID. Download only after state is succeeded and billing_state is settled. Polling and download example.

image to image · 4K · 1 output

API configuration ID836b9fb0-2c39-48be-ae1f-9070cb90579a

image to image

Estimated totalMeldport $0.183876/ generation

4K · 1 output. Final cost may differ from the estimate. See billing details.

Variable billing details
API request and parameters

Use images:generate on your API key. This configuration runs image to image and returns image/jpeg.

Upload an image using the same API key, then replace YOUR_UPLOADED_ASSET_ID. Input upload example. Choose a different configuration ID to change the workflow or output settings. Send only options listed below.

These output settings are included in this configuration. Select another configuration ID to change them. Do not add them to options.

generation_parametersJSON
{
  "resolution": "4K"
}

This configuration has no additional request options.

Replace the prompt and set a unique MELDPORT_IDEMPOTENCY_KEY for this operation. The example quotes the request and then creates one paid job. Read the billing rules before accepting variable charges.

generate.mjsJavaScript
const api = "https://api.meldport.com";
const key = process.env.MELDPORT_API_KEY;
const idempotencyKey = process.env.MELDPORT_IDEMPOTENCY_KEY;
if (!key || !idempotencyKey) throw new Error("Set your API key and a unique operation ID first.");

async function post(path, body) {
  const response = await fetch(api + path, {method: "POST",
    headers: {Authorization: `Bearer ${key}`, "Content-Type": "application/json"},
    body: JSON.stringify(body)});
  const result = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(result.error));
  return result;
}

const request = {
  "configuration_id": "836b9fb0-2c39-48be-ae1f-9070cb90579a",
  "prompt": "Replace with your prompt or speech script.",
  "options": {},
  "input_asset_ids": [
    "YOUR_UPLOADED_ASSET_ID"
  ]
};
const {data: quote} = await post("/v1/media/quotes", request);
console.log("Quote:", quote);
const result = await post("/v1/media/jobs", {
  ...request, idempotency_key: idempotencyKey,
  accepted_customer_price_microusd: quote.customer_price_microusd,
  accepted_maximum_reservation_microusd: quote.maximum_reservation_microusd,
  ...(quote.billing_policy_version === "actual-cost-v1"
    ? {billing_policy_version: "actual-cost-v1"} : {}),
});
console.log(result.job);
// Poll GET /v1/media/jobs/<job.id> with the same API key.
// Keep this operation ID for retries. A new ID requests another generation.

Poll the returned job ID. Download only after state is succeeded and billing_state is settled. Polling and download example.

About this model

Nano Banana 2 (officially known as Gemini 3.1 Flash Image) is Google’s upgraded AI image generation and editing model that brings advanced visual creation capabilities to a broad audience. It generates detailed, expressive images from text and image prompts with sharp details, richer lighting, and improved adherence to complex instructions. Nano Banana 2 also supports multi-object and multi-character consistency, accurate text rendering within images, and flexible resolution control up to 4K. It is now integrated across Google’s AI platforms including the Gemini app, Search AI Mode, and other Gemini-powered services.

  • text to image
  • image to image
  • video to image
  • op:edit
  • checkpoint

Nano Banana 2 API FAQ

Does Nano Banana 2 have an API?

Yes. Meldport publishes 6 image configurations for Nano Banana 2. Quote the request, then submit a job with the images:generate scope; the same API key covers quoting, polling, and download.

How much does the Nano Banana 2 API cost?

Published configurations start at an estimated $0.082740 per generation. These configurations use actual-cost billing, so the final charge can differ from the estimate. Quote the exact request before submitting to see the customer price and maximum reservation.

Which configuration ID should I send?

Send a published configuration ID from this page, such as 37c79f27-523b-4c9d-bea2-c855dbd4bcb6. Each configuration fixes the workflow and output settings, and its price is listed on this page. Changing the configuration does not require a new API key.

How do I get an API key for Nano Banana 2?

Create a Meldport account, add a workspace API key with the images:generate scope, and keep the key on your server. The API reference covers key creation and scopes.

How are Nano Banana 2 results delivered?

POST /v1/media/jobs returns a job instead of a finished file. Poll GET /v1/media/jobs/{job_id} until state is succeeded and billing_state is settled, then request a download URL. Outputs are retained for 8 days.

How do I choose a Nano Banana 2 configuration?

Choose the workflow first: generate from a text prompt or edit an uploaded image. Then compare output sizes within that workflow. A price for one size does not apply to every Nano Banana 2 configuration. The comparison on this page lists published workflows, output settings and rates. Sizes listed for this model are not necessarily available for every workflow; use the exact configuration row.

Do I need a direct google API key?

The examples on this page call api.meldport.com with a Meldport workspace key. They do not call google's direct API. The model ID identifies this catalog page; send a published configuration ID when quoting or creating a media job.