Skip to main content
POST
/
v1
/
ai
/
text-to-image
/
nano-banana-pro-flash
Create image from text - Nano Banana Pro Flash
curl --request POST \
  --url https://api.magnific.com/v1/ai/text-to-image/nano-banana-pro-flash \
  --header 'Content-Type: application/json' \
  --header 'x-magnific-api-key: <api-key>' \
  --data '
{
  "prompt": "A suited raccoon smoking a pipe in a vintage study room",
  "webhook_url": "https://www.example.com/webhook",
  "reference_images": [
    {
      "image": "https://example.com/reference.jpg",
      "text": "Reference style",
      "mime_type": "image/jpeg"
    }
  ],
  "aspect_ratio": "1:1",
  "resolution": "1K",
  "use_google_search_tool": false
}
'
{
  "data": {
    "generated": [],
    "task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
    "status": "IN_PROGRESS"
  }
}

Authorizations

x-magnific-api-key
string
header
required

Your Magnific API key. Required for authentication. Learn how to obtain an API key

Body

application/json
prompt
string
required

Text prompt describing the image you want to generate.

Tips:

  • Be specific about visual details, composition, and style
  • Nano Banana Pro Flash is optimized for speed while maintaining quality
  • Enable Google Search grounding for images that need real-world accuracy

Examples:

  • Simple: "A suited raccoon smoking a pipe"
  • Detailed: "A suited raccoon smoking a pipe in a vintage study room, warm lighting, leather armchair, bookshelves in background"
Required string length: 2 - 3000
Example:

"A suited raccoon smoking a pipe in a vintage study room"

webhook_url
string<uri>

Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

Example:

"https://www.example.com/webhook"

reference_images
object[]

Optional reference images for guided generation. Each image can include associated text and mime type.

Image requirements:

  • Maximum 14 images
  • Supported formats: PNG, JPEG, WebP
  • Publicly accessible URLs or GCS format
Maximum array length: 14
Example:
[
{
"image": "https://example.com/reference.jpg",
"text": "Reference style",
"mime_type": "image/jpeg"
}
]
aspect_ratio
enum<string>
default:1:1

Aspect ratio for the generated image.

Available ratios:

  • 1:1: Square (default)
  • 2:3, 3:2: Portrait/Landscape
  • 4:3, 3:4: Standard
  • 5:4, 4:5: Photo print
  • 16:9, 9:16: Widescreen/Social stories
  • 21:9: Ultra-wide cinematic
Available options:
1:1,
2:3,
3:2,
4:3,
3:4,
5:4,
4:5,
16:9,
9:16,
21:9
Example:

"1:1"

resolution
enum<string>
default:1K

Resolution quality for the generated image.

Available resolutions:

  • 1K: Lower resolution, faster generation (default)
  • 2K: Standard resolution, balanced quality/speed
  • 4K: High resolution, best quality
Available options:
1K,
2K,
4K,
low,
medium,
high
Example:

"1K"

use_google_search_tool
boolean
default:false

Enable Google Search grounding during image generation. When enabled, the model uses Google Search to ground its output with real-world information, improving accuracy for prompts that reference real places, people, brands, or current events.

Note: When enabled, the task response may include grounding metadata with source information.

Response

OK - The request has succeeded and the Nano Banana Pro Flash process has started.

data
object
required
Example:
{
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED",
"generated": [
"https://openapi-generator.tech",
"https://openapi-generator.tech"
]
}