ModelStream LogoModelStream Logo
Models
Video API
Image API
Chat API
Audio API
Studio
Pricing
Docs
Menu
IntroductionQuickstartAPI KeysUse with Hermes AgentUse with OpenClaw
Model ListBilling Guide
ModelStream

Video API

  • Seedance 2.0
  • Happyhorse 1.0
  • Vidu Q3
  • Kling V3.0
  • Veo 3.1
  • Wan 2.7
  • More Video Models →

Image API

  • GPT Image 2
  • Nano Banana 2
  • Seedream 5.0
  • Imagen 4
  • Qwen Image 2.0
  • Z-Image Turbo
  • More Image Models →

Audio API

  • Suno Music
  • Qwen3 TTS Flash
  • More Audio Models →

Chat API

  • GLM-5.2
  • Claude Opus 4.8
  • Gemini 3.5 Flash
  • Qwen 3.7 Max
  • GPT 5.5
  • More Chat Models →

About Us

  • Privacy Policy
  • Terms of Service
  • Support
  • Enterprise

© 2026 ModelStream Inc. All rights reserved.

API Documentation
API Reference
Images
Generate Image

Generate Image

Loading models...
N
Nano Banana 2 (NB2)
NB20 models support this endpoint

Nano Banana 2 combines the high-speed capabilities of Gemini Flash with Pro-level world knowledge, reasoning, and visual quality, achieving fast editing and high-fidelity generation. It supports real-time knowledge enhancement, precise text rendering and translation, theme consistency for up to five roles and fourteen objects, accurate execution of complex instructions, and multi-resolution output from 512px to 4K, delivering clearer details and photorealistic visual performance.

Generate image

https://api.modelstream.ai
POST/v1/images/generations

Authentication

BearerAuth
AuthenticationBearer <token>

All API requests must be authenticated using a Bearer token in the Authorization header. Please ensure your API key is active.Authorization: Bearer sk-xxxxxx

Parameter Location: Header Param

Request Body

application/json

These parameters come from the selected model form_schema. Switching models updates this list and the request example.

Generation Mode

Choose the generation mode. Text to Image: generate from the prompt only. Image to Image: upload reference images and edit, restyle, or blend them per the prompt.

prompt*string

Text description of the image. Nano Banana 2 (Gemini 3.1 Flash Image) generates or edits images from the prompt, with strong text rendering and multi-image blending.

RequiredExample Value: A close-up editorial portrait of a beautiful female model by the seaside, soft ocean breeze moving her hair, natural sunlight illuminating her face, glowing skin, detailed facial features, calm and confident expression. The background shows a dreamy beach and sparkling blue sea with a softly blurred shoreline. Luxury fashion photography style, clean composition, fresh summer feeling, cinematic lighting, shallow depth of field, ultra realistic, high resolution.Placeholder: Describe the image you want to generate or edit...
size?string

Aspect ratio of the output image. Default 1:1.

Example Value: 1:1
Enum/Options:
1:12:33:23:44:34:55:49:1616:921:91:41:84:18:1
quality?string

Output resolution, default 1K. 512 is the fastest, lowest resolution; 4K is the highest.

Example Value: 1K
Enum/Options:
5121K2K4K
thinking_level?string

Reasoning effort during generation. MINIMAL has the lowest latency; HIGH spends more reasoning to improve quality on complex scenes. Default MINIMAL.

Example Value: MINIMAL
Enum/Options:
MINIMALHIGH
gweb_search?boolean

When enabled, the model can ground generation in real-time web search for up-to-date information.

Example Value: false

Response Parameters

application/json
200apiDocs.responses.successGenerateImage
created?integer

Parameter description for Created

data?array

Parameter description for Data

curl -X POST "https://api.modelstream.ai/v1/images/generations" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "NB2",
  "prompt": "A close-up editorial portrait of a beautiful female model by the seaside, soft ocean breeze moving her hair, natural sunlight illuminating her face, glowing skin, detailed facial features, calm and confident expression. The background shows a dreamy beach and sparkling blue sea with a softly blurred shoreline. Luxury fashion photography style, clean composition, fresh summer feeling, cinematic lighting, shallow depth of field, ultra realistic, high resolution.",
  "n": 1,
  "size": "4:3",
  "quality": "1K",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "A close-up editorial portrait of a beautiful female model by the seaside, soft ocean breeze moving her hair, natural sunlight illuminating her face, glowing skin, detailed facial features, calm and confident expression. The background shows a dreamy beach and sparkling blue sea with a softly blurred shoreline. Luxury fashion photography style, clean composition, fresh summer feeling, cinematic lighting, shallow depth of field, ultra realistic, high resolution."
        }
      ]
    }
  ],
  "extra_body": {
    "g_model": {
      "thinking_config": {
        "thinking_level": "MINIMAL"
      }
    }
  }
}'
{
  "created": 0,
  "data": [
    {
      "url": "string",
      "b64_json": "string",
      "revised_prompt": "string"
    }
  ]
}