微软/azure-image-2

GPT-Image 2 是 OpenAI 的图像生成与编辑模型,适合文字生成图片、参考图改图、商品图优化、海报素材、创意概念图和营销视觉制作。它适合需要较高画面质量、指令理解和商业可用性的图片生成场景。

OperationalText to ImageImage to ImageImage Editing-20%vs officialPriced by usage dimensionsCommercial useData privacy

Inputlive schema

参考图reference_images
No test requests yet. Send your first request.

Output

Run the form on the left. Results, polling status and cURL appear under the form.

Pricing

This model is priced by the usage dimensions listed here. Compare all pricing.

List prices in USD. Your effective price also depends on the billing group attached to your API key.

Criteria文本输入 Tokensgpt-image-2-az
$4.00per 1M5/1M
Criteria图片输入 Tokensgpt-image-2-az
$6.40per 1M8/1M
Criteria缓存文本输入 Tokensgpt-image-2-az
$1.00per 1M1.25/1M
Criteria缓存图片输入 Tokensgpt-image-2-az
$1.60per 1M2/1M
Criteria图片输出 Tokensgpt-image-2-az
$24.00per 1M30/1M

API

POST/v1/images/generations
const BASE_URL = "https://api.dreamtoai.com";
const API_KEY = process.env.MIX_API_KEY;

const headers = {
  "Authorization": `Bearer ${API_KEY}`,
  "Content-Type": "application/json",
};

const payload = {
  "model": "gpt-image-2-az",
  "input": {
    "prompt": "生成一张产品海报,白色背景,商业摄影风格",
    "image_url": "https://example.com/input.png",
    "reference_images": [
      "https://example.com/reference.png"
    ],
    "mask": "https://example.com/mask.png",
    "size": "2752x1536",
    "quality": "medium",
    "output_format": "png",
    "background": "auto",
    "n": 1,
    "user": "user-123",
    "style": "Describe the output you want",
    "response_format": "url"
  }
};

const submit = await fetch(`${BASE_URL}/v1/jobs`, {
  method: "POST",
  headers,
  body: JSON.stringify(payload),
}).then((r) => r.json());

const status = await fetch(`${BASE_URL}/v1/jobs/${submit.id}`, { headers })
  .then((r) => r.json());
console.log(status);

Create a key in Console → API Keys and replace the placeholder in the sample.

README

azure-image-2

GPT-Image 2 是 OpenAI 的图像生成与编辑模型,适合文字生成图片、参考图改图、商品图优化、海报素材、创意概念图和营销视觉制作。它适合需要较高画面质量、指令理解和商业可用性的图片生成场景。

Why Choose This?

Text-to-image generation
Turns natural-language prompts into finished images.
Pay as you go
Billed per use from your wallet, with no subscription.
Prompt caching
Cached input is billed at $1.00 per 1M tokens, which cuts the cost of repeated context.
Works with your existing SDK
Call it in the OpenAI Images format, so existing clients only need a new base URL and key.
One key for every model
The same API key works for every model on dreamtoai.

Parameters

ParameterRequiredDescription
promptstringRequiredText description of what to generate.
image_urlimageOptionalReference image to guide the result.
reference_imagesarrayOptional参考图
maskimageOptional遮罩图
sizestringOptionalOutput image size.
qualityenumOptionalOutput quality level. Options: auto, low, medium, high. Default: auto.
output_formatenumOptional输出格式 Options: png, jpeg, webp. Default: png.
backgroundenumOptional背景 Options: auto, transparent, opaque.
nintegerOptionalNumber of outputs to generate.
userstringOptional终端用户标识
stylestringOptional风格
response_formatenumOptionalFormat of the returned result, such as a URL or base64 data. Options: base64, url.

How to Use

  1. Try it here first — Sign in and run the model in the playground above to check the output before you write code.
  2. Create an API key — Open Console → API Keys and create a key. The same key works for every model.
  3. Write your prompt — Describe the subject, style, composition and lighting you want.
  4. Set optional parameters — Adjust the optional parameters listed above to control the output.
  5. Send the request — Call POST /v1/images/generations with the model ID gpt-image-2-az.
  6. Read the result — The generated output comes back in the response and the request is logged in the console.

Writing Effective Prompts

The model reads a prompt like a creative brief. Name the subject first, then add the details that matter.

1. Subject and action

Who or what is in the image, and what it is doing.

2. Style and medium

Photo, 3D render, watercolor or flat illustration. For photographic looks, name a lens or film stock.

3. Composition

Framing and viewpoint: close-up, wide shot, overhead, centered, rule of thirds.

4. Lighting and color

Golden hour, soft studio light, neon, a pastel palette, high contrast.

5. Text in the image

Put the exact words in quotes and say where they go.

A poster with the headline "OPEN LATE" in bold white letters across the top.
Prompt
Weaka coffee shop
StrongA cozy corner coffee shop on a rainy evening, seen through the front window. Warm tungsten light inside, a barista pouring latte art, condensation on the glass, street reflections. 35mm photo, shallow depth of field, muted teal and amber palette.

Pricing

Billing itemPriceOfficial price
文本输入 Tokens$4.00 per 1M$5.00/1M
图片输入 Tokens$6.40 per 1M$8.00/1M
缓存文本输入 Tokens$1.00 per 1M$1.25/1M
缓存图片输入 Tokens$1.60 per 1M$2.00/1M
图片输出 Tokens$24.00 per 1M$30.00/1M

That is 20% below the official list price.

List prices in USD. Your effective price also depends on the billing group attached to your API key. Compare all pricing

Best Use Cases

  • Marketing and ads — Produce campaign visuals and ad variations in minutes.
  • E-commerce — Create product shots, lifestyle scenes and banners.
  • Concept art and storyboards — Explore characters, environments and scenes before production.
  • Social media content — Make on-brand images in square, portrait or landscape formats.
  • Design exploration — Try layouts, palettes and styles quickly.
  • Editorial illustration — Illustrate articles, newsletters and presentations.

Pro Tips

  • Generate a few variations of a promising prompt before refining the details.
  • Keep the subject in the first sentence; add style and lighting after it.
  • Keep a long shared prefix identical across requests so repeated input is billed at the cache price.
  • Put any text that should appear in the image in quotes.
  • Pick the aspect ratio for where the image will be used before generating.
  • Reuse the same seed, when the model offers one, to compare prompt changes fairly.

Browse all image modelsBrowse API Market

FAQ

What is azure-image-2?

GPT-Image 2 是 OpenAI 的图像生成与编辑模型,适合文字生成图片、参考图改图、商品图优化、海报素材、创意概念图和营销视觉制作。它适合需要较高画面质量、指令理解和商业可用性的图片生成场景。

How do I call the azure-image-2 API?

Send POST /v1/images/generations with the model ID gpt-image-2-az and your API key. Ready-to-run samples are in the API section above.

How is billing calculated?

Requests are billed at the prices listed above and charged to your wallet. Final cost depends on usage and the billing group attached to your API key.

Where do I get an API key?

Create one in Console → API Keys. The same key works for every model on the gateway.

Can I use the output commercially?

Yes. You can use what you generate in commercial projects, subject to the model provider’s terms.

About azure-image-2 on dreamtoai

GPT-Image 2 是 OpenAI 的图像生成与编辑模型,适合文字生成图片、参考图改图、商品图优化、海报素材、创意概念图和营销视觉制作。它适合需要较高画面质量、指令理解和商业可用性的图片生成场景。

Related models

Next steps