@runapi.ai/nano-banana 0.2.7 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
- /** Generation model tiers: standard (fast), pro (higher resolution + more refs), v2 (longest prompts + extreme ratios). */
5
- type TextToImageModel = 'nano-banana' | 'nano-banana-pro' | 'nano-banana-2';
6
- /** Dedicated editing model. Requires source images to transform. */
7
- type EditImageModel = 'nano-banana-edit';
4
+ /** Generation model tiers: standard (fast), pro (higher resolution + more refs), v2, and v2 lite. */
5
+ type TextToImageModel = 'nano-banana' | 'nano-banana-pro' | 'nano-banana-2' | 'nano-banana-2-lite';
6
+ /** Editing-capable Nano Banana models. */
7
+ type EditImageModel = 'nano-banana-edit' | 'nano-banana-2-lite';
8
8
  /** Aspect ratio options for the standard model. */
9
9
  type BaseAspectRatio = '1:1' | '9:16' | '16:9' | '3:4' | '4:3' | '3:2' | '2:3' | '5:4' | '4:5' | '21:9' | 'auto';
10
10
  /** Aspect ratio options for the pro model. */
@@ -18,6 +18,8 @@ type AspectRatioV2 = AspectRatio | '1:4' | '1:8' | '4:1' | '8:1';
18
18
  type OutputResolution = '1k' | '2k' | '4k';
19
19
  /** Output image encoding format. */
20
20
  type OutputFormat = 'png' | 'jpg' | 'jpeg';
21
+ /** Output image encoding format for the dedicated edit model. */
22
+ type EditOutputFormat = 'png' | 'jpeg';
21
23
  /** Standard tier generation. Up to 8 reference images, max 5000-char prompt. */
22
24
  interface GenerationBaseParams {
23
25
  model: 'nano-banana';
@@ -50,25 +52,49 @@ interface GenerationV2Params {
50
52
  /** Optional visual guidance images (up to 14, max 30 MB each). */
51
53
  reference_image_urls?: string[];
52
54
  }
55
+ /** V2 Lite generation. Requires aspect_ratio, accepts up to 10 references, and has no output format or resolution controls. */
56
+ interface GenerationV2LiteParams {
57
+ /** Defaults to `nano-banana-2-lite` when omitted. */
58
+ model?: 'nano-banana-2-lite';
59
+ prompt: string;
60
+ callback_url?: string;
61
+ aspect_ratio: AspectRatioV2;
62
+ /** Optional visual guidance images (up to 10, max 30 MB each). */
63
+ reference_image_urls?: string[];
64
+ }
53
65
  /**
54
66
  * Text-to-image parameters. A discriminated union on `model`: the accepted
55
67
  * aspect ratios, prompt length, resolution, and reference image count differ per tier.
56
68
  */
57
- type TextToImageParams = GenerationBaseParams | GenerationProParams | GenerationV2Params;
58
- /**
59
- * Edit image parameters. Requires source images to modify according to the prompt.
60
- * Up to 10 source images, max 10 MB each.
61
- */
62
- interface EditImageParams {
69
+ type TextToImageParams = GenerationBaseParams | GenerationProParams | GenerationV2Params | GenerationV2LiteParams;
70
+ /** Dedicated edit model. Requires source images and supports output format control. */
71
+ interface EditImageBaseParams {
63
72
  model: 'nano-banana-edit';
64
73
  /** Edit instruction describing the desired changes (up to 5000 chars). */
65
74
  prompt: string;
66
75
  /** Source images to edit (up to 10 images, max 10 MB each). */
67
76
  source_image_urls: string[];
68
77
  callback_url?: string;
69
- output_format?: OutputFormat;
78
+ output_format?: EditOutputFormat;
70
79
  aspect_ratio?: BaseAspectRatio;
71
80
  }
81
+ /** V2 Lite edit. Requires aspect_ratio and does not accept output_format. */
82
+ interface EditImageV2LiteParams {
83
+ /** Defaults to `nano-banana-2-lite` when omitted. */
84
+ model?: 'nano-banana-2-lite';
85
+ /** Edit instruction describing the desired changes (up to 20000 chars). */
86
+ prompt: string;
87
+ /** Source images to edit (up to 10 images). */
88
+ source_image_urls: string[];
89
+ callback_url?: string;
90
+ aspect_ratio: AspectRatioV2;
91
+ }
92
+ /**
93
+ * Edit image parameters. A discriminated union on `model`: the dedicated edit
94
+ * model supports output format, while V2 Lite requires aspect ratio and omits
95
+ * output format controls.
96
+ */
97
+ type EditImageParams = EditImageBaseParams | EditImageV2LiteParams;
72
98
  interface TaskCreateResponse {
73
99
  id: string;
74
100
  }
@@ -145,7 +171,7 @@ declare class EditImage {
145
171
  private readonly http;
146
172
  constructor(http: HttpClient);
147
173
  /**
148
- * Edit an image using text prompts and reference images and wait until complete.
174
+ * Edit an image using text prompts and source images and wait until complete.
149
175
  * @param params Edit parameters.
150
176
  * @param options Per-request and polling overrides.
151
177
  * @returns The completed edit with image results.
@@ -170,9 +196,8 @@ declare class EditImage {
170
196
  /**
171
197
  * NanoBanana image generation and editing API client.
172
198
  *
173
- * Three generation tiers: standard (fast), pro (higher resolution, more
174
- * reference images), and v2 (longest prompts, extreme aspect ratios, up to 14
175
- * reference images). Editing uses the dedicated `nano-banana-edit` model.
199
+ * Generation tiers include standard, pro, v2, and v2 lite. Image editing
200
+ * supports `nano-banana-2-lite` and the dedicated `nano-banana-edit` model.
176
201
  *
177
202
  * @example
178
203
  * ```typescript
@@ -195,4 +220,4 @@ declare class NanoBananaClient extends BaseClient {
195
220
  constructor(options?: ClientOptions);
196
221
  }
197
222
 
198
- export { type AspectRatio, type AspectRatioV2, type BaseAspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageModel, type EditImageParams, type EditImageResponse, type GenerationBaseParams, type GenerationProParams, type GenerationV2Params, type Image, NanoBananaClient, type OutputFormat, type OutputResolution, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse };
223
+ export { type AspectRatio, type AspectRatioV2, type BaseAspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageBaseParams, type EditImageModel, type EditImageParams, type EditImageResponse, type EditImageV2LiteParams, type EditOutputFormat, type GenerationBaseParams, type GenerationProParams, type GenerationV2LiteParams, type GenerationV2Params, type Image, NanoBananaClient, type OutputFormat, type OutputResolution, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { AsyncTaskStatus, HttpClient, RequestOptions, PollingOptions, BaseClient, ClientOptions } from '@runapi.ai/core';
2
2
  export { AuthenticationError, InsufficientCreditsError, NetworkError, NotFoundError, RateLimitError, RunApiError, ServiceUnavailableError, TaskFailedError, TaskTimeoutError, TimeoutError, ValidationError } from '@runapi.ai/core';
3
3
 
4
- /** Generation model tiers: standard (fast), pro (higher resolution + more refs), v2 (longest prompts + extreme ratios). */
5
- type TextToImageModel = 'nano-banana' | 'nano-banana-pro' | 'nano-banana-2';
6
- /** Dedicated editing model. Requires source images to transform. */
7
- type EditImageModel = 'nano-banana-edit';
4
+ /** Generation model tiers: standard (fast), pro (higher resolution + more refs), v2, and v2 lite. */
5
+ type TextToImageModel = 'nano-banana' | 'nano-banana-pro' | 'nano-banana-2' | 'nano-banana-2-lite';
6
+ /** Editing-capable Nano Banana models. */
7
+ type EditImageModel = 'nano-banana-edit' | 'nano-banana-2-lite';
8
8
  /** Aspect ratio options for the standard model. */
9
9
  type BaseAspectRatio = '1:1' | '9:16' | '16:9' | '3:4' | '4:3' | '3:2' | '2:3' | '5:4' | '4:5' | '21:9' | 'auto';
10
10
  /** Aspect ratio options for the pro model. */
@@ -18,6 +18,8 @@ type AspectRatioV2 = AspectRatio | '1:4' | '1:8' | '4:1' | '8:1';
18
18
  type OutputResolution = '1k' | '2k' | '4k';
19
19
  /** Output image encoding format. */
20
20
  type OutputFormat = 'png' | 'jpg' | 'jpeg';
21
+ /** Output image encoding format for the dedicated edit model. */
22
+ type EditOutputFormat = 'png' | 'jpeg';
21
23
  /** Standard tier generation. Up to 8 reference images, max 5000-char prompt. */
22
24
  interface GenerationBaseParams {
23
25
  model: 'nano-banana';
@@ -50,25 +52,49 @@ interface GenerationV2Params {
50
52
  /** Optional visual guidance images (up to 14, max 30 MB each). */
51
53
  reference_image_urls?: string[];
52
54
  }
55
+ /** V2 Lite generation. Requires aspect_ratio, accepts up to 10 references, and has no output format or resolution controls. */
56
+ interface GenerationV2LiteParams {
57
+ /** Defaults to `nano-banana-2-lite` when omitted. */
58
+ model?: 'nano-banana-2-lite';
59
+ prompt: string;
60
+ callback_url?: string;
61
+ aspect_ratio: AspectRatioV2;
62
+ /** Optional visual guidance images (up to 10, max 30 MB each). */
63
+ reference_image_urls?: string[];
64
+ }
53
65
  /**
54
66
  * Text-to-image parameters. A discriminated union on `model`: the accepted
55
67
  * aspect ratios, prompt length, resolution, and reference image count differ per tier.
56
68
  */
57
- type TextToImageParams = GenerationBaseParams | GenerationProParams | GenerationV2Params;
58
- /**
59
- * Edit image parameters. Requires source images to modify according to the prompt.
60
- * Up to 10 source images, max 10 MB each.
61
- */
62
- interface EditImageParams {
69
+ type TextToImageParams = GenerationBaseParams | GenerationProParams | GenerationV2Params | GenerationV2LiteParams;
70
+ /** Dedicated edit model. Requires source images and supports output format control. */
71
+ interface EditImageBaseParams {
63
72
  model: 'nano-banana-edit';
64
73
  /** Edit instruction describing the desired changes (up to 5000 chars). */
65
74
  prompt: string;
66
75
  /** Source images to edit (up to 10 images, max 10 MB each). */
67
76
  source_image_urls: string[];
68
77
  callback_url?: string;
69
- output_format?: OutputFormat;
78
+ output_format?: EditOutputFormat;
70
79
  aspect_ratio?: BaseAspectRatio;
71
80
  }
81
+ /** V2 Lite edit. Requires aspect_ratio and does not accept output_format. */
82
+ interface EditImageV2LiteParams {
83
+ /** Defaults to `nano-banana-2-lite` when omitted. */
84
+ model?: 'nano-banana-2-lite';
85
+ /** Edit instruction describing the desired changes (up to 20000 chars). */
86
+ prompt: string;
87
+ /** Source images to edit (up to 10 images). */
88
+ source_image_urls: string[];
89
+ callback_url?: string;
90
+ aspect_ratio: AspectRatioV2;
91
+ }
92
+ /**
93
+ * Edit image parameters. A discriminated union on `model`: the dedicated edit
94
+ * model supports output format, while V2 Lite requires aspect ratio and omits
95
+ * output format controls.
96
+ */
97
+ type EditImageParams = EditImageBaseParams | EditImageV2LiteParams;
72
98
  interface TaskCreateResponse {
73
99
  id: string;
74
100
  }
@@ -145,7 +171,7 @@ declare class EditImage {
145
171
  private readonly http;
146
172
  constructor(http: HttpClient);
147
173
  /**
148
- * Edit an image using text prompts and reference images and wait until complete.
174
+ * Edit an image using text prompts and source images and wait until complete.
149
175
  * @param params Edit parameters.
150
176
  * @param options Per-request and polling overrides.
151
177
  * @returns The completed edit with image results.
@@ -170,9 +196,8 @@ declare class EditImage {
170
196
  /**
171
197
  * NanoBanana image generation and editing API client.
172
198
  *
173
- * Three generation tiers: standard (fast), pro (higher resolution, more
174
- * reference images), and v2 (longest prompts, extreme aspect ratios, up to 14
175
- * reference images). Editing uses the dedicated `nano-banana-edit` model.
199
+ * Generation tiers include standard, pro, v2, and v2 lite. Image editing
200
+ * supports `nano-banana-2-lite` and the dedicated `nano-banana-edit` model.
176
201
  *
177
202
  * @example
178
203
  * ```typescript
@@ -195,4 +220,4 @@ declare class NanoBananaClient extends BaseClient {
195
220
  constructor(options?: ClientOptions);
196
221
  }
197
222
 
198
- export { type AspectRatio, type AspectRatioV2, type BaseAspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageModel, type EditImageParams, type EditImageResponse, type GenerationBaseParams, type GenerationProParams, type GenerationV2Params, type Image, NanoBananaClient, type OutputFormat, type OutputResolution, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse };
223
+ export { type AspectRatio, type AspectRatioV2, type BaseAspectRatio, type CompletedEditImageResponse, type CompletedTextToImageResponse, type EditImageBaseParams, type EditImageModel, type EditImageParams, type EditImageResponse, type EditImageV2LiteParams, type EditOutputFormat, type GenerationBaseParams, type GenerationProParams, type GenerationV2LiteParams, type GenerationV2Params, type Image, NanoBananaClient, type OutputFormat, type OutputResolution, type TaskCreateResponse, type TextToImageModel, type TextToImageParams, type TextToImageResponse };
package/dist/index.js CHANGED
@@ -46,9 +46,41 @@ var import_internal = require("@runapi.ai/core/internal");
46
46
  var contract = {
47
47
  "edit-image": {
48
48
  "models": [
49
+ "nano-banana-2-lite",
49
50
  "nano-banana-edit"
50
51
  ],
51
52
  "fields_by_model": {
53
+ "nano-banana-2-lite": {
54
+ "aspect_ratio": {
55
+ "enum": [
56
+ "1:1",
57
+ "1:4",
58
+ "1:8",
59
+ "2:3",
60
+ "3:2",
61
+ "3:4",
62
+ "4:1",
63
+ "4:3",
64
+ "4:5",
65
+ "5:4",
66
+ "8:1",
67
+ "9:16",
68
+ "16:9",
69
+ "21:9",
70
+ "auto"
71
+ ],
72
+ "required": true
73
+ },
74
+ "prompt": {
75
+ "required": true,
76
+ "min": 1,
77
+ "max": 2e4,
78
+ "length": true
79
+ },
80
+ "source_image_urls": {
81
+ "required": true
82
+ }
83
+ },
52
84
  "nano-banana-edit": {
53
85
  "aspect_ratio": {
54
86
  "enum": [
@@ -75,12 +107,23 @@ var contract = {
75
107
  "required": true
76
108
  }
77
109
  }
78
- }
110
+ },
111
+ "rules": [
112
+ {
113
+ "when": {
114
+ "model": "nano-banana-2-lite"
115
+ },
116
+ "forbidden": [
117
+ "output_format"
118
+ ]
119
+ }
120
+ ]
79
121
  },
80
122
  "text-to-image": {
81
123
  "models": [
82
124
  "nano-banana",
83
125
  "nano-banana-2",
126
+ "nano-banana-2-lite",
84
127
  "nano-banana-pro"
85
128
  ],
86
129
  "fields_by_model": {
@@ -143,6 +186,34 @@ var contract = {
143
186
  ]
144
187
  }
145
188
  },
189
+ "nano-banana-2-lite": {
190
+ "aspect_ratio": {
191
+ "enum": [
192
+ "1:1",
193
+ "1:4",
194
+ "1:8",
195
+ "2:3",
196
+ "3:2",
197
+ "3:4",
198
+ "4:1",
199
+ "4:3",
200
+ "4:5",
201
+ "5:4",
202
+ "8:1",
203
+ "9:16",
204
+ "16:9",
205
+ "21:9",
206
+ "auto"
207
+ ],
208
+ "required": true
209
+ },
210
+ "prompt": {
211
+ "required": true,
212
+ "min": 1,
213
+ "max": 2e4,
214
+ "length": true
215
+ }
216
+ },
146
217
  "nano-banana-pro": {
147
218
  "aspect_ratio": {
148
219
  "enum": [
@@ -174,12 +245,24 @@ var contract = {
174
245
  ]
175
246
  }
176
247
  }
177
- }
248
+ },
249
+ "rules": [
250
+ {
251
+ "when": {
252
+ "model": "nano-banana-2-lite"
253
+ },
254
+ "forbidden": [
255
+ "output_resolution",
256
+ "output_format"
257
+ ]
258
+ }
259
+ ]
178
260
  }
179
261
  };
180
262
 
181
263
  // src/resources/text-to-image.ts
182
264
  var ENDPOINT = "/api/v1/nano_banana/text_to_image";
265
+ var DEFAULT_MODEL = "nano-banana-2-lite";
183
266
  var TextToImage = class {
184
267
  constructor(http) {
185
268
  this.http = http;
@@ -206,7 +289,7 @@ var TextToImage = class {
206
289
  * @returns The task creation result with id.
207
290
  */
208
291
  async create(params, options) {
209
- const body = (0, import_core.compactParams)(params);
292
+ const body = { model: DEFAULT_MODEL, ...(0, import_core.compactParams)(params) };
210
293
  (0, import_core.validateParams)(contract["text-to-image"], body);
211
294
  return this.http.request("POST", ENDPOINT, {
212
295
  body,
@@ -230,13 +313,14 @@ var TextToImage = class {
230
313
  var import_core2 = require("@runapi.ai/core");
231
314
  var import_internal2 = require("@runapi.ai/core/internal");
232
315
  var ENDPOINT2 = "/api/v1/nano_banana/edit_image";
316
+ var DEFAULT_MODEL2 = "nano-banana-2-lite";
233
317
  var EditImage = class {
234
318
  constructor(http) {
235
319
  this.http = http;
236
320
  }
237
321
  http;
238
322
  /**
239
- * Edit an image using text prompts and reference images and wait until complete.
323
+ * Edit an image using text prompts and source images and wait until complete.
240
324
  * @param params Edit parameters.
241
325
  * @param options Per-request and polling overrides.
242
326
  * @returns The completed edit with image results.
@@ -256,7 +340,7 @@ var EditImage = class {
256
340
  * @returns The task creation result with id.
257
341
  */
258
342
  async create(params, options) {
259
- const body = (0, import_core2.compactParams)(params);
343
+ const body = { model: DEFAULT_MODEL2, ...(0, import_core2.compactParams)(params) };
260
344
  (0, import_core2.validateParams)(contract["edit-image"], body);
261
345
  return this.http.request("POST", ENDPOINT2, {
262
346
  body,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts"],"sourcesContent":["export { NanoBananaClient } from './client';\nexport * from './types';\n\n// Re-export core errors for convenience\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * NanoBanana image generation and editing API client.\n *\n * Three generation tiers: standard (fast), pro (higher resolution, more\n * reference images), and v2 (longest prompts, extreme aspect ratios, up to 14\n * reference images). Editing uses the dedicated `nano-banana-edit` model.\n *\n * @example\n * ```typescript\n * const client = new NanoBananaClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToImage.run({\n * model: 'nano-banana-pro',\n * prompt: 'A futuristic cityscape at night',\n * });\n * ```\n */\nexport class NanoBananaClient extends BaseClient {\n /** Generate images from text prompts with optional reference image guidance. */\n public readonly textToImage: TextToImage;\n /** Edit existing images using text prompts and source images. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/text_to_image';\n\n/** Generates images from text prompts with optional reference image guidance. Model tier controls prompt length, resolution, and reference image limits. */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate an image from a text prompt and wait until complete.\n * @param params Generation parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed generation with image results.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create an image generation task; returns immediately with a task id.\n * @param params Generation parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image generation task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image generation task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"nano-banana-edit\"\n ],\n \"fields_by_model\": {\n \"nano-banana-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-image\": {\n \"models\": [\n \"nano-banana\",\n \"nano-banana-2\",\n \"nano-banana-pro\"\n ],\n \"fields_by_model\": {\n \"nano-banana\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n }\n },\n \"nano-banana-2\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n },\n \"nano-banana-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type { CompletedEditImageResponse, EditImageParams, EditImageResponse, TaskCreateResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/edit_image';\n\n/** Modifies existing images based on text prompts. Requires source images to edit. */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Edit an image using text prompts and reference images and wait until complete.\n * @param params Edit parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit with image results.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an image edit task; returns immediately with a task id.\n * @param params Edit parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image edit task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image edit task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,eAA+C;;;ACC/C,kBAA8C;AAC9C,sBAAkC;;;ACF3B,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,oBAAoB;AAAA,QAClB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,iBAAiB;AAAA,UACf,QAAQ;AAAA,YACN;AAAA,YACA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MAAM,KAAK,OAAO,QAAQ,OAAO;AAChD,UAAM,WAAW,UAAM,oCAAqC,MAAM,KAAK,IAAI,IAAI,OAAO,GAAG;AAAA,MACvF,WAAW,SAAS;AAAA,MACpB,gBAAgB,SAAS;AAAA,IAC3B,CAAC;AACD,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAO,QAAyB,SAAuD;AAC3F,UAAM,WAAO,4BAAc,MAAM;AACjC,qCAAe,SAAS,YAAY,GAAmB,IAA+B;AACtF,WAAO,KAAK,KAAK,QAA4B,QAAQA,WAAU;AAAA,MAC7D;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MACtE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH7BO,IAAM,mBAAN,cAA+B,wBAAW;AAAA;AAAA,EAE/B;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AD/BA,IAAAC,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","import_core"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts"],"sourcesContent":["export { NanoBananaClient } from './client';\nexport * from './types';\n\n// Re-export core errors for convenience\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n","import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * NanoBanana image generation and editing API client.\n *\n * Generation tiers include standard, pro, v2, and v2 lite. Image editing\n * supports `nano-banana-2-lite` and the dedicated `nano-banana-edit` model.\n *\n * @example\n * ```typescript\n * const client = new NanoBananaClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToImage.run({\n * model: 'nano-banana-pro',\n * prompt: 'A futuristic cityscape at night',\n * });\n * ```\n */\nexport class NanoBananaClient extends BaseClient {\n /** Generate images from text prompts with optional reference image guidance. */\n public readonly textToImage: TextToImage;\n /** Edit existing images using text prompts and source images. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/text_to_image';\nconst DEFAULT_MODEL = 'nano-banana-2-lite';\n\n/** Generates images from text prompts with optional reference image guidance. Model tier controls prompt length, resolution, and reference image limits. */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate an image from a text prompt and wait until complete.\n * @param params Generation parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed generation with image results.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create an image generation task; returns immediately with a task id.\n * @param params Generation parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = { model: DEFAULT_MODEL, ...compactParams(params) };\n validateParams(contract['text-to-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image generation task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image generation task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"nano-banana-2-lite\",\n \"nano-banana-edit\"\n ],\n \"fields_by_model\": {\n \"nano-banana-2-lite\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 1,\n \"max\": 20000,\n \"length\": true\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"nano-banana-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"nano-banana-2-lite\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n }\n ]\n },\n \"text-to-image\": {\n \"models\": [\n \"nano-banana\",\n \"nano-banana-2\",\n \"nano-banana-2-lite\",\n \"nano-banana-pro\"\n ],\n \"fields_by_model\": {\n \"nano-banana\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n }\n },\n \"nano-banana-2\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n },\n \"nano-banana-2-lite\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 1,\n \"max\": 20000,\n \"length\": true\n }\n },\n \"nano-banana-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"nano-banana-2-lite\"\n },\n \"forbidden\": [\n \"output_resolution\",\n \"output_format\"\n ]\n }\n ]\n }\n} as const;\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type { CompletedEditImageResponse, EditImageParams, EditImageResponse, TaskCreateResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/edit_image';\nconst DEFAULT_MODEL = 'nano-banana-2-lite';\n\n/** Modifies existing images based on text prompts. Requires source images to edit. */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Edit an image using text prompts and source images and wait until complete.\n * @param params Edit parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit with image results.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an image edit task; returns immediately with a task id.\n * @param params Edit parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = { model: DEFAULT_MODEL, ...compactParams(params) };\n validateParams(contract['edit-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image edit task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image edit task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('GET', `${ENDPOINT}/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EA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AD9BA,IAAAE,eAYO;","names":["import_core","import_core","import_internal","ENDPOINT","DEFAULT_MODEL","import_core"]}
package/dist/index.mjs CHANGED
@@ -9,9 +9,41 @@ import { pollUntilComplete } from "@runapi.ai/core/internal";
9
9
  var contract = {
10
10
  "edit-image": {
11
11
  "models": [
12
+ "nano-banana-2-lite",
12
13
  "nano-banana-edit"
13
14
  ],
14
15
  "fields_by_model": {
16
+ "nano-banana-2-lite": {
17
+ "aspect_ratio": {
18
+ "enum": [
19
+ "1:1",
20
+ "1:4",
21
+ "1:8",
22
+ "2:3",
23
+ "3:2",
24
+ "3:4",
25
+ "4:1",
26
+ "4:3",
27
+ "4:5",
28
+ "5:4",
29
+ "8:1",
30
+ "9:16",
31
+ "16:9",
32
+ "21:9",
33
+ "auto"
34
+ ],
35
+ "required": true
36
+ },
37
+ "prompt": {
38
+ "required": true,
39
+ "min": 1,
40
+ "max": 2e4,
41
+ "length": true
42
+ },
43
+ "source_image_urls": {
44
+ "required": true
45
+ }
46
+ },
15
47
  "nano-banana-edit": {
16
48
  "aspect_ratio": {
17
49
  "enum": [
@@ -38,12 +70,23 @@ var contract = {
38
70
  "required": true
39
71
  }
40
72
  }
41
- }
73
+ },
74
+ "rules": [
75
+ {
76
+ "when": {
77
+ "model": "nano-banana-2-lite"
78
+ },
79
+ "forbidden": [
80
+ "output_format"
81
+ ]
82
+ }
83
+ ]
42
84
  },
43
85
  "text-to-image": {
44
86
  "models": [
45
87
  "nano-banana",
46
88
  "nano-banana-2",
89
+ "nano-banana-2-lite",
47
90
  "nano-banana-pro"
48
91
  ],
49
92
  "fields_by_model": {
@@ -106,6 +149,34 @@ var contract = {
106
149
  ]
107
150
  }
108
151
  },
152
+ "nano-banana-2-lite": {
153
+ "aspect_ratio": {
154
+ "enum": [
155
+ "1:1",
156
+ "1:4",
157
+ "1:8",
158
+ "2:3",
159
+ "3:2",
160
+ "3:4",
161
+ "4:1",
162
+ "4:3",
163
+ "4:5",
164
+ "5:4",
165
+ "8:1",
166
+ "9:16",
167
+ "16:9",
168
+ "21:9",
169
+ "auto"
170
+ ],
171
+ "required": true
172
+ },
173
+ "prompt": {
174
+ "required": true,
175
+ "min": 1,
176
+ "max": 2e4,
177
+ "length": true
178
+ }
179
+ },
109
180
  "nano-banana-pro": {
110
181
  "aspect_ratio": {
111
182
  "enum": [
@@ -137,12 +208,24 @@ var contract = {
137
208
  ]
138
209
  }
139
210
  }
140
- }
211
+ },
212
+ "rules": [
213
+ {
214
+ "when": {
215
+ "model": "nano-banana-2-lite"
216
+ },
217
+ "forbidden": [
218
+ "output_resolution",
219
+ "output_format"
220
+ ]
221
+ }
222
+ ]
141
223
  }
142
224
  };
143
225
 
144
226
  // src/resources/text-to-image.ts
145
227
  var ENDPOINT = "/api/v1/nano_banana/text_to_image";
228
+ var DEFAULT_MODEL = "nano-banana-2-lite";
146
229
  var TextToImage = class {
147
230
  constructor(http) {
148
231
  this.http = http;
@@ -169,7 +252,7 @@ var TextToImage = class {
169
252
  * @returns The task creation result with id.
170
253
  */
171
254
  async create(params, options) {
172
- const body = compactParams(params);
255
+ const body = { model: DEFAULT_MODEL, ...compactParams(params) };
173
256
  validateParams(contract["text-to-image"], body);
174
257
  return this.http.request("POST", ENDPOINT, {
175
258
  body,
@@ -193,13 +276,14 @@ var TextToImage = class {
193
276
  import { compactParams as compactParams2, validateParams as validateParams2 } from "@runapi.ai/core";
194
277
  import { pollUntilComplete as pollUntilComplete2 } from "@runapi.ai/core/internal";
195
278
  var ENDPOINT2 = "/api/v1/nano_banana/edit_image";
279
+ var DEFAULT_MODEL2 = "nano-banana-2-lite";
196
280
  var EditImage = class {
197
281
  constructor(http) {
198
282
  this.http = http;
199
283
  }
200
284
  http;
201
285
  /**
202
- * Edit an image using text prompts and reference images and wait until complete.
286
+ * Edit an image using text prompts and source images and wait until complete.
203
287
  * @param params Edit parameters.
204
288
  * @param options Per-request and polling overrides.
205
289
  * @returns The completed edit with image results.
@@ -219,7 +303,7 @@ var EditImage = class {
219
303
  * @returns The task creation result with id.
220
304
  */
221
305
  async create(params, options) {
222
- const body = compactParams2(params);
306
+ const body = { model: DEFAULT_MODEL2, ...compactParams2(params) };
223
307
  validateParams2(contract["edit-image"], body);
224
308
  return this.http.request("POST", ENDPOINT2, {
225
309
  body,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * NanoBanana image generation and editing API client.\n *\n * Three generation tiers: standard (fast), pro (higher resolution, more\n * reference images), and v2 (longest prompts, extreme aspect ratios, up to 14\n * reference images). Editing uses the dedicated `nano-banana-edit` model.\n *\n * @example\n * ```typescript\n * const client = new NanoBananaClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToImage.run({\n * model: 'nano-banana-pro',\n * prompt: 'A futuristic cityscape at night',\n * });\n * ```\n */\nexport class NanoBananaClient extends BaseClient {\n /** Generate images from text prompts with optional reference image guidance. */\n public readonly textToImage: TextToImage;\n /** Edit existing images using text prompts and source images. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/text_to_image';\n\n/** Generates images from text prompts with optional reference image guidance. Model tier controls prompt length, resolution, and reference image limits. */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate an image from a text prompt and wait until complete.\n * @param params Generation parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed generation with image results.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create an image generation task; returns immediately with a task id.\n * @param params Generation parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['text-to-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image generation task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image generation task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"nano-banana-edit\"\n ],\n \"fields_by_model\": {\n \"nano-banana-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n }\n },\n \"text-to-image\": {\n \"models\": [\n \"nano-banana\",\n \"nano-banana-2\",\n \"nano-banana-pro\"\n ],\n \"fields_by_model\": {\n \"nano-banana\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n }\n },\n \"nano-banana-2\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n },\n \"nano-banana-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n }\n }\n }\n} as const;\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type { CompletedEditImageResponse, EditImageParams, EditImageResponse, TaskCreateResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/edit_image';\n\n/** Modifies existing images based on text prompts. Requires source images to edit. */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Edit an image using text prompts and reference images and wait until complete.\n * @param params Edit parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit with image results.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an image edit task; returns immediately with a task id.\n * @param params Edit parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = compactParams(params);\n validateParams(contract['edit-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image edit task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image edit task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { NanoBananaClient } from './client';\nexport * from './types';\n\n// Re-export core errors for convenience\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,kBAAsC;;;ACC/C,SAAS,eAAe,sBAAsB;AAC9C,SAAS,yBAAyB;;;ACF3B,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,oBAAoB;AAAA,QAClB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AA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names":["compactParams","validateParams","pollUntilComplete","ENDPOINT","pollUntilComplete","compactParams","validateParams"]}
1
+ {"version":3,"sources":["../src/client.ts","../src/resources/text-to-image.ts","../src/contract_gen.ts","../src/resources/edit-image.ts","../src/index.ts"],"sourcesContent":["import { BaseClient, type ClientOptions } from '@runapi.ai/core';\nimport { TextToImage } from './resources/text-to-image';\nimport { EditImage } from './resources/edit-image';\n\n/**\n * NanoBanana image generation and editing API client.\n *\n * Generation tiers include standard, pro, v2, and v2 lite. Image editing\n * supports `nano-banana-2-lite` and the dedicated `nano-banana-edit` model.\n *\n * @example\n * ```typescript\n * const client = new NanoBananaClient({\n * apiKey: 'your-api-key',\n * baseUrl: 'https://runapi.ai',\n * });\n *\n * const result = await client.textToImage.run({\n * model: 'nano-banana-pro',\n * prompt: 'A futuristic cityscape at night',\n * });\n * ```\n */\nexport class NanoBananaClient extends BaseClient {\n /** Generate images from text prompts with optional reference image guidance. */\n public readonly textToImage: TextToImage;\n /** Edit existing images using text prompts and source images. */\n public readonly editImage: EditImage;\n\n constructor(options: ClientOptions = {}) {\n super(options);\n this.textToImage = new TextToImage(this.http);\n this.editImage = new EditImage(this.http);\n }\n}\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type {\n CompletedTextToImageResponse,\n TextToImageParams,\n TextToImageResponse,\n TaskCreateResponse,\n} from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/text_to_image';\nconst DEFAULT_MODEL = 'nano-banana-2-lite';\n\n/** Generates images from text prompts with optional reference image guidance. Model tier controls prompt length, resolution, and reference image limits. */\nexport class TextToImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Generate an image from a text prompt and wait until complete.\n * @param params Generation parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed generation with image results.\n */\n async run(params: TextToImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedTextToImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<TextToImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedTextToImageResponse;\n }\n\n /**\n * Create an image generation task; returns immediately with a task id.\n * @param params Generation parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: TextToImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = { model: DEFAULT_MODEL, ...compactParams(params) };\n validateParams(contract['text-to-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image generation task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image generation task status.\n */\n async get(id: string, options?: RequestOptions): Promise<TextToImageResponse> {\n return this.http.request<TextToImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export const contract = {\n \"edit-image\": {\n \"models\": [\n \"nano-banana-2-lite\",\n \"nano-banana-edit\"\n ],\n \"fields_by_model\": {\n \"nano-banana-2-lite\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 1,\n \"max\": 20000,\n \"length\": true\n },\n \"source_image_urls\": {\n \"required\": true\n }\n },\n \"nano-banana-edit\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\"\n ]\n },\n \"source_image_urls\": {\n \"required\": true\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"nano-banana-2-lite\"\n },\n \"forbidden\": [\n \"output_format\"\n ]\n }\n ]\n },\n \"text-to-image\": {\n \"models\": [\n \"nano-banana\",\n \"nano-banana-2\",\n \"nano-banana-2-lite\",\n \"nano-banana-pro\"\n ],\n \"fields_by_model\": {\n \"nano-banana\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"9:16\",\n \"16:9\",\n \"3:4\",\n \"4:3\",\n \"3:2\",\n \"2:3\",\n \"5:4\",\n \"4:5\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n }\n },\n \"nano-banana-2\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n },\n \"nano-banana-2-lite\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"1:4\",\n \"1:8\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:1\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"8:1\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ],\n \"required\": true\n },\n \"prompt\": {\n \"required\": true,\n \"min\": 1,\n \"max\": 20000,\n \"length\": true\n }\n },\n \"nano-banana-pro\": {\n \"aspect_ratio\": {\n \"enum\": [\n \"1:1\",\n \"2:3\",\n \"3:2\",\n \"3:4\",\n \"4:3\",\n \"4:5\",\n \"5:4\",\n \"9:16\",\n \"16:9\",\n \"21:9\",\n \"auto\"\n ]\n },\n \"output_format\": {\n \"enum\": [\n \"png\",\n \"jpeg\",\n \"jpg\"\n ]\n },\n \"output_resolution\": {\n \"enum\": [\n \"1k\",\n \"2k\",\n \"4k\"\n ]\n }\n }\n },\n \"rules\": [\n {\n \"when\": {\n \"model\": \"nano-banana-2-lite\"\n },\n \"forbidden\": [\n \"output_resolution\",\n \"output_format\"\n ]\n }\n ]\n }\n} as const;\n","import type { HttpClient, RequestOptions, PollingOptions, ActionSchema } from '@runapi.ai/core';\nimport { compactParams, validateParams } from '@runapi.ai/core';\nimport { pollUntilComplete } from '@runapi.ai/core/internal';\nimport { contract } from '../contract_gen';\nimport type { CompletedEditImageResponse, EditImageParams, EditImageResponse, TaskCreateResponse } from '../types';\n\nconst ENDPOINT = '/api/v1/nano_banana/edit_image';\nconst DEFAULT_MODEL = 'nano-banana-2-lite';\n\n/** Modifies existing images based on text prompts. Requires source images to edit. */\nexport class EditImage {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Edit an image using text prompts and source images and wait until complete.\n * @param params Edit parameters.\n * @param options Per-request and polling overrides.\n * @returns The completed edit with image results.\n */\n async run(params: EditImageParams, options?: RequestOptions & PollingOptions): Promise<CompletedEditImageResponse> {\n const { id } = await this.create(params, options);\n const response = await pollUntilComplete<EditImageResponse>(() => this.get(id, options), {\n maxWaitMs: options?.maxWaitMs,\n pollIntervalMs: options?.pollIntervalMs,\n });\n return response as CompletedEditImageResponse;\n }\n\n /**\n * Create an image edit task; returns immediately with a task id.\n * @param params Edit parameters.\n * @param options Per-request overrides.\n * @returns The task creation result with id.\n */\n async create(params: EditImageParams, options?: RequestOptions): Promise<TaskCreateResponse> {\n const body = { model: DEFAULT_MODEL, ...compactParams(params) };\n validateParams(contract['edit-image'] as ActionSchema, body as Record<string, unknown>);\n return this.http.request<TaskCreateResponse>('POST', ENDPOINT, {\n body,\n ...options,\n });\n }\n\n /**\n * Fetch the current status of an image edit task.\n * @param id The task id.\n * @param options Per-request overrides.\n * @returns The current image edit task status.\n */\n async get(id: string, options?: RequestOptions): Promise<EditImageResponse> {\n return this.http.request<EditImageResponse>('GET', `${ENDPOINT}/${id}`, {\n ...options,\n });\n }\n}\n","export { NanoBananaClient } from './client';\nexport * from './types';\n\n// Re-export core errors for convenience\nexport {\n RunApiError,\n AuthenticationError,\n InsufficientCreditsError,\n NotFoundError,\n ValidationError,\n RateLimitError,\n ServiceUnavailableError,\n NetworkError,\n TimeoutError,\n TaskTimeoutError,\n TaskFailedError,\n} from '@runapi.ai/core';\n"],"mappings":";AAAA,SAAS,kBAAsC;;;ACC/C,SAAS,eAAe,sBAAsB;AAC9C,SAAS,yBAAyB;;;ACF3B,IAAM,WAAW;AAAA,EACtB,cAAc;AAAA,IACZ,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB,sBAAsB;AAAA,QACpB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,YAAY;AAAA,QACd;AAAA,QACA,UAAU;AAAA,UACR,YAAY;AAAA,UACZ,OAAO;AAAA,UACP,OAAO;AAAA,UACP,UAAU;AAAA,QACZ;AAAA,QACA,qBAAqB;AAAA,UACnB,YAAY;AAAA,QACd;AAAA,MACF;AAAA,MACA,oBAAoB;AAAA,QAClB,gBAAgB;AAAA,UACd,QAAQ;AAAA,YACN;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,QACA,iBAAiB;AAAA,UACf,QAA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,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAI,IAAY,SAAsD;AAC1E,WAAO,KAAK,KAAK,QAA2B,OAAO,GAAGA,SAAQ,IAAI,EAAE,IAAI;AAAA,MACtE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AACF;;;AH/BO,IAAM,mBAAN,cAA+B,WAAW;AAAA;AAAA,EAE/B;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,UAAyB,CAAC,GAAG;AACvC,UAAM,OAAO;AACb,SAAK,cAAc,IAAI,YAAY,KAAK,IAAI;AAC5C,SAAK,YAAY,IAAI,UAAU,KAAK,IAAI;AAAA,EAC1C;AACF;;;AI9BA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["compactParams","validateParams","pollUntilComplete","ENDPOINT","DEFAULT_MODEL","pollUntilComplete","compactParams","validateParams"]}
package/package.json CHANGED
@@ -3,8 +3,8 @@
3
3
  "runapi": {
4
4
  "slug": "nano-banana"
5
5
  },
6
- "version": "0.2.7",
7
- "description": "RunAPI Nano Banana SDK for text-to-image and image editing workflows in JavaScript, Python, Ruby, Go, and Java",
6
+ "version": "0.2.10",
7
+ "description": "RunAPI Nano Banana SDK for text-to-image and image editing workflows in JavaScript, Python, Ruby, Go, Java, and PHP",
8
8
  "main": "./dist/index.js",
9
9
  "module": "./dist/index.mjs",
10
10
  "types": "./dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "clean": "rm -rf dist"
32
32
  },
33
33
  "dependencies": {
34
- "@runapi.ai/core": "^0.2.7"
34
+ "@runapi.ai/core": "^0.2.11"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^20.0.0",
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <br/>
23
23
 
24
- Generate and edit images with Nano Banana standard, pro, and edit models. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate Nano Banana through RunAPI.
24
+ Generate and edit images with Nano Banana standard, pro, v2, v2 lite, and edit models. This skill helps Claude Code, Codex, Gemini CLI, Cursor, and 50+ agents integrate Nano Banana through RunAPI.
25
25
 
26
26
  The canonical agent file is `skills/nano-banana/SKILL.md`.
27
27
 
@@ -74,6 +74,7 @@ const url = result.images[0].url;
74
74
  - [Pro](https://runapi.ai/models/nano-banana/pro)
75
75
  - [Edit](https://runapi.ai/models/nano-banana/edit)
76
76
  - [Nano Banana 2](https://runapi.ai/models/nano-banana/2)
77
+ - [Nano Banana 2 Lite](https://runapi.ai/models/nano-banana/2-lite)
77
78
 
78
79
  ## Agent rules
79
80
 
@@ -36,7 +36,7 @@ Generate and edit images with Nano Banana through RunAPI. The default path for o
36
36
  When integrating Nano Banana into an app, backend, worker, library, Rails service, Node service, Go service, webhook pipeline, or production workflow, start by checking the current SDK package and official usage. Confirm install commands, client methods (`create`, `get`, `run`), request fields, response shape, and error classes before using CLI help or raw HTTP examples. Use a RunAPI SDK package:
37
37
 
38
38
  - JavaScript / TypeScript: `@runapi.ai/nano-banana`
39
- - Ruby: `runapi-nano_banana`
39
+ - Ruby: `runapi-nano-banana`
40
40
  - Go: `github.com/runapi-ai/nano-banana-sdk/go`
41
41
 
42
42
  ## CLI path
@@ -81,4 +81,4 @@ RunAPI-generated file URLs are temporary. Download and store generated images, v
81
81
  - [Pro](https://runapi.ai/models/nano-banana/pro.md)
82
82
  - [Edit](https://runapi.ai/models/nano-banana/edit.md)
83
83
  - [Nano Banana 2](https://runapi.ai/models/nano-banana/2.md)
84
-
84
+ - [Nano Banana 2 Lite](https://runapi.ai/models/nano-banana/2-lite.md)