Output resolution
Supports 1k, 2k, 4k from the published endpoint schema.
Built on Gemini 3.1 Flash; best multi-character consistency, 4–8s
curl -X POST https://runapi.ai/api/v1/nano_banana/text_to_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2",
"prompt": "Create a motivational poster with the text 'Never Give Up' in bold serif, sunset mountains in the background."
}'
import { NanoBananaClient } from "@runapi.ai/nano-banana";
const client = new NanoBananaClient();
const result = await client.textToImage.run({
model: "nano-banana-2",
prompt: "Create a motivational poster with the text 'Never Give Up' in bold serif, sunset mountains in the background.",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/nano_banana/text_to_image",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"nano-banana-2","prompt":"Create a motivational poster with the text 'Never Give Up' in bold serif, sunset mountains in the background."}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/nano_banana/text_to_image");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'nano-banana-2',
'prompt' => 'Create a motivational poster with the text \'Never Give Up\' in bold serif, sunset mountains in the background.',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToImage().run({"model":"nano-banana-2","prompt":"Create a motivational poster with the text 'Never Give Up' in bold serif, sunset mountains in the background."});
task.waitForResult();
require "runapi/nano_banana"
client = RunApi::NanoBanana::Client.new
result = client.text_to_image.run(
model: "nano-banana-2",
prompt: "Create a motivational poster with the text 'Never Give Up' in bold serif, sunset mountains in the background."
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToImage.Run({"model":"nano-banana-2","prompt":"Create a motivational poster with the text 'Never Give Up' in bold serif, sunset mountains in the background."})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model nano-banana-2 \
--endpoint text_to_image \
--wait
5 versions available
Pick any model and generate in seconds.
| Provider | |
| Model ID | nano-banana-2 |
| Modality | Image |
| Task types | Asynchronous |
| API endpoint | /api/v1/nano_banana/text_to_image |
| Billing unit | call |
| Input parameters | aspect_ratio, output_format, output_resolution |
| Max resolution | 1k, 2k, 4k |
| Aspect ratios | 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9, auto |
| Output format | png, jpeg, jpg |
| Catalog status | Operational |
Sign up for free and create an API key for nano-banana-2 from the dashboard.
POST to /api/v1/nano_banana/text_to_image with the nano-banana-2 model slug and your parameters.
Poll the task or follow the callback to retrieve the completed nano-banana-2 result.
Supports 1k, 2k, 4k from the published endpoint schema.
Configure 3 documented parameters, including aspect_ratio, output_format, output_resolution.
Exposes 1 public endpoint(s): text_to_image.
Metered by call with no subscription requirement.
aspect_ratioNo description available. (1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9, auto)
output_formatNo description available. (png, jpeg, jpg)
output_resolutionNo description available. (1k, 2k, 4k)
Auto-generate lifestyle product photos for e-commerce catalogs that lack studio photography.
Rapidly concept environments and characters before committing to final art.
Generate unique cover art and illustrations for blog posts and articles at scale.
Pass the model ID shown in the quickstart.
Per-key rate limits scale with your usage tier. The pricing page shows current limits. If you need higher throughput, contact support to discuss tier upgrades.
Yes. Variant is a parameter in the request. Switch by changing the model ID — no code changes, no re-authentication, no separate billing setup. All variants share the same API key and request shape.
Where streaming is available, RunAPI streams end-to-end. LLM models support token-level streaming. Media models use async task polling or webhook callbacks for result delivery.
Open an issue on the public GitHub repo or email support at [email protected]. Include the task ID and model ID so the team can investigate the specific generation.
No. Your RunAPI API key is enough to access this variant and every other model in the catalog. You do not need accounts with the underlying provider.
We're here to help with enterprise setup, integrations, and technical questions.
Contact Us