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...
G
GPT Image 2 (gpt-image-2)
gpt-image-20 models support this endpoint

GPT-Image-2 represents a milestone leap in OpenAI's image generation technology. Building upon version 1.5, it significantly enhances the capacity to capture subtle linguistic nuances and abstract concepts, producing visual masterpieces with photorealistic quality, intricate textures, and cinematic compositions. With qualitative breakthroughs in human anatomy, complex ray-tracing, and native text rendering, it is the pinnacle choice for cinematic concept design, digital art, and high-end brand asset development.

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 (Edit): upload one or more images and edit, compose, or inpaint them with a prompt (optional mask).

prompt*string

Describe the image you want to generate in detail; in Image-to-Image mode, describe how to edit the uploaded images. Max 32,000 characters.

RequiredExample Value: A vibrant lifestyle fashion poster featuring a bright and stylish young female model wearing a clean oversized graphic T-shirt, standing confidently in a sunlit urban setting. She has a fresh, energetic expression, natural makeup, healthy glowing skin, and slightly windswept hair. Her pose feels relaxed and playful, capturing the spirit of youth, freedom, and summer energy. The T-shirt is clearly visible as the visual focus, with a modern streetwear silhouette and enough clean space on the fabric for a logo or custom print design. Bright daylight, soft shadows, vivid but natural colors, dynamic composition, commercial fashion campaign style, high-end editorial photography, crisp fabric texture, realistic details, youthful atmosphere, clean poster layout, premium lifestyle branding, high resolution.Placeholder: e.g., A bustling futuristic city at night in cyberpunk style...
size?string

Specify the output image size. Choose 1024x1024, 1536x1024, or 1024x1536. Default 1024x1024.

Example Value: 1024x1024
Enum/Options:
1024x10241536x10241024x1536
background?string

Set background transparency. Transparency only works with PNG or WebP.

Example Value: auto
Enum/Options:
Auto: autoTransparent: transparentOpaque: opaque
quality?string

Select the generation quality level, affecting image detail. Choose Low, Medium, or High. Default Medium.

Example Value: medium
Enum/Options:
Low: lowMedium: mediumHigh: high
output_format?string

The file format of the generated image.

Example Value: png
Enum/Options:
PNG: pngWebP: webpJPEG: jpeg
n?number

Number of images to generate per request (1-10).

Example Value: 1Value Range: 1 ≤ value ≤ 10step: 1
partial_images?number

Number of partial images to stream (0-3). 0 returns only the final image.

Example Value: 0Value Range: 0 ≤ value ≤ 3step: 1
moderation?string

Control the level of content moderation and filtering.

Example Value: auto
Enum/Options:
Auto: autoLow: low
output_compression?number

Compression level (0-100%). Only for WebP and JPEG.

Example Value: 100Value Range: 0 ≤ value ≤ 100step: 1

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": "gpt-image-2",
  "prompt": "A vibrant lifestyle fashion poster featuring a bright and stylish young female model wearing a clean oversized graphic T-shirt, standing confidently in a sunlit urban setting. She has a fresh, energetic expression, natural makeup, healthy glowing skin, and slightly windswept hair. Her pose feels relaxed and playful, capturing the spirit of youth, freedom, and summer energy. The T-shirt is clearly visible as the visual focus, with a modern streetwear silhouette and enough clean space on the fabric for a logo or custom print design. Bright daylight, soft shadows, vivid but natural colors, dynamic composition, commercial fashion campaign style, high-end editorial photography, crisp fabric texture, realistic details, youthful atmosphere, clean poster layout, premium lifestyle branding, high resolution.",
  "size": "1024x1024",
  "background": "auto",
  "moderation": "auto",
  "n": 1,
  "quality": "high",
  "output_format": "png",
  "output_compression": 100,
  "partial_images": 0,
  "stream": true
}'
{
  "created": 0,
  "data": [
    {
      "url": "string",
      "b64_json": "string",
      "revised_prompt": "string"
    }
  ]
}