Skip to content

How to Generate an Image

Generate an image from a text prompt.

Quick Start

Add ?sync=true to get the result in one request:

bash
curl -X POST "https://api.get3w.com/v1/google/nano-banana-pro/text-to-image?sync=true" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A serene Japanese garden with cherry blossoms, golden hour lighting",
    "aspect_ratio": "1:1",
    "resolution": "1k",
    "output_format": "png",
    "channel": "stable"
  }'
python
import requests

response = requests.post(
    "https://api.get3w.com/v1/google/nano-banana-pro/text-to-image?sync=true",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "A serene Japanese garden with cherry blossoms, golden hour lighting",
        "aspect_ratio": "1:1",
        "resolution": "1k",
        "output_format": "png",
        "channel": "stable"
    }
)

data = response.json()
print(data["outputs"][0])
javascript
const response = await fetch(
    "https://api.get3w.com/v1/google/nano-banana-pro/text-to-image?sync=true",
    {
        method: "POST",
        headers: {
            "Authorization": "Bearer YOUR_API_KEY",
            "Content-Type": "application/json"
        },
        body: JSON.stringify({
            prompt: "A serene Japanese garden with cherry blossoms, golden hour lighting",
            aspect_ratio: "1:1",
            resolution: "1k",
            output_format: "png",
            channel: "stable"
        })
    }
);

const data = await response.json();
console.log(data.outputs[0]);

Choosing a Model

SlugBest for
google/nano-banana-pro/text-to-imageStrong all-rounder, fast
bytedance/seedream-5-pro/text-to-imagePhotorealism
bytedance/seedream-5-lite/text-to-imageCheaper iterations
black-forest-labs/flux-2-pro/text-to-imagePrompt adherence, detail
alibaba/qwen-image-2-pro/text-to-imageText rendering in images
midjourney/v8.2/text-to-imageStylized, artistic output
recraft/recraft-4.1-vector/text-to-imageVector art and logos
ideogram/ideogram-3/text-to-imageTypography and posters

Browse the full catalog at get3w.com/models.

Common Parameters

ParameterTypeDescription
promptstringText description of the image
aspect_ratiostringFraming, e.g. 1:1, 16:9, 9:16
resolutionstringOutput resolution, e.g. 1k, 2k
output_formatstringFile format, e.g. png, jpeg
seedintegerSeed for reproducibility
channelstringService tier, e.g. economy, stable

Accepted values differ per model — check the model's page for its exact schema. An unsupported value comes back as task code 1401.

Tips for Better Results

  1. Be specific — "A golden retriever playing fetch in a park at sunset" beats "a dog"
  2. Include style keywords — "cinematic", "photorealistic", "watercolor"
  3. Specify lighting — "golden hour", "studio lighting", "dramatic shadows"
  4. Match the aspect ratio to the use case9:16 for mobile, 16:9 for video thumbnails
  5. Pin the seed once you like a result, so you can iterate on the prompt without losing the composition

Editing an Existing Image

Switch the run type to image-to-image and pass an input image:

bash
curl -X POST "https://api.get3w.com/v1/google/nano-banana-pro/image-to-image?sync=true" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Transform into a watercolor painting style",
    "image_urls": ["https://your-cdn.com/your-image.png"]
  }'

Input images must be at publicly reachable URLs. If a URL cannot be fetched, the task fails with code 1402.

Next Steps

Released under the MIT License.