namifusion

How to Use the OpenAI GPT Image 2 Text-to-Image API: text to image integration guide (2026)

2 min · Updated 2026-07-11 · By the NamiFusion team

Learn how to call the OpenAI GPT Image 2 Text-to-Image API on NamiFusion: parameters, pricing (from ≈$0.220) and runnable copy-paste code — try it in the playground first.

OpenAI GPT Image 2 Text-to-Image is a text to image model by OpenAI: OpenAI's GPT Image 2 Text-to-Image generates high-quality images from natural-language prompts. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing. On NamiFusion you can try it in the playground (exact quote shown before you submit), then call it through one unified REST API — a typical run costs about $0.220.

TL;DR

· Task type: text to image, provided by OpenAI

· Pricing: about $0.220 per typical run ($1 = 100 credits), pay-as-you-go

· Getting started: playground (exact quote before submit) → create an API key → one POST request

· Tunable parameters: 9 (see the table below)

· No platform watermark; commercial use allowed (per the Terms of Service)

What can you build with OpenAI GPT Image 2 Text-to-Image?

Social media visuals and covers: batch-generate on-theme images and schedule them straight away.

E-commerce and ad creatives: product scenes, banner backgrounds, and multi-variant visuals for A/B tests.

Concept art and ideation: characters, environments and style boards, iterated cheaply and fast.

Pipeline chaining: outputs feed directly into image-to-video or face swap as source material.

How do you call this API?

1. Sign up on NamiFusion and create a key on the API Keys page (free credits on signup).

2. Submit a task with the cURL example below, passing your key as a Bearer token.

3. Poll the task status with the returned task_uuid and read the output URLs when completed.

Submit a task
# 1) Submit — returns { "task_uuid": "..." }
curl -X POST "https://www.namifusion.com/api/v1/marketplace/run/openai/gpt-image-2/text-to-image" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "prompt": "A futuristic cityscape at sunset, with glowing skyscrapers and flying cars.",
    "n": 3,
    "aspect_ratio": "16:9",
    "resolution": "4k",
    "size": "1024x1024",
    "quality": "high",
    "output_format": "jpeg",
    "output_compression": 85,
    "moderation": "auto"
  }
}'

# 2) Poll until status is "completed", then read the output URLs
curl "https://www.namifusion.com/api/v1/marketplace/run/tasks/TASK_UUID" \
  -H "Authorization: Bearer YOUR_API_KEY"

What parameters does it take?

prompt (Prompt): required

n (Image Count): optional, default 1

aspect_ratio (Aspect Ratio): optional, default "1:1"

resolution (Resolution): optional, default "1k"

size (Size): optional, default "auto"

quality (Quality): optional, default "auto"

output_format (Output Format): optional, default "png"

output_compression (Compression): optional

moderation (Moderation): optional, default "auto"

How do you write prompts for OpenAI GPT Image 2 Text-to-Image?

1. Subject first: lead with the actor and action, then add environment, lighting and style ("an astronaut sprinting through a neon street in the rain, cinematic, shallow depth of field").

2. Concrete nouns beat stacked adjectives: "85mm portrait lens, golden-hour backlight" works far better than "very beautiful, ultra high quality".

3. Change one variable per iteration: pin the seed to reproduce a result, tweak a single phrase at a time so you know what actually moved the output.

4. State negatives positively: instead of "no blur", ask for "sharp focus, crisp details".

How much does it cost?

Pay-per-use in credits. A typical run costs about $0.220 ($1 = 100 credits); the exact price varies with parameters like resolution or duration, and the playground shows the exact quote before you submit.

OpenAI GPT Image 2 Text-to-Image

Transform text into stunning visuals with unparalleled quality and precision.

OpenAI GPT Image 2 Text-to-Image is a cutting-edge model designed to generate high-quality images from natural-language prompts. With strong prompt fidelity, flexible aspect ratios, and production-ready API access, this model is ideal for developers and creators seeking polished visuals for diverse applications. Enjoy seamless performance with no cold starts and affordable pricing.

🚀 Key Features

  • Strong Prompt Fidelity: Generates images that closely follow detailed natural-language instructions, including scene layout, visual style, and composition.
  • High-Quality Image Generation: Produces polished visuals suitable for marketing creatives, concept design, product mockups, and branded content.
  • Flexible Aspect Ratios: Supports square, portrait, and landscape outputs for various use cases, including social media, editorial, and product visuals.
  • Accurate Text Rendering: Creates images with clearer, more usable in-image text for posters, ads, packaging, and interface mockups.
  • Production-Ready API: Access the model through a ready-to-use REST inference API for fast integration into applications and workflows.

🛠️ Technical Specifications

ParameterDescriptionOptions/Range
promptText description of the desired image.Required
aspect_ratioAspect ratio of the generated image.1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
resolutionOutput resolution of the image.1k (default), 2k
qualityImage quality level. Higher quality costs more.low, medium (default), high

Example Prompt

A cinematic product photo of a luxury perfume bottle on a marble surface, soft golden-hour lighting, shallow depth of field, elegant reflections, premium editorial photography style.

💰 Pricing

ModelModalityInputCached inputOutput
gpt-image-2Image$8.00$2.00$30.00
Text$5.00$1.25-

FAQ

Can I try it for free first?+

Signup gives you free credits, but they currently apply only to selected in-app face-swap features — this model is pay-as-you-go. The playground still lets you try it without code, with the exact quote shown before you submit.

Can I use the output commercially? Is there a watermark?+

Yes, outputs are yours to use commercially, and NamiFusion adds no platform watermark — subject to the Terms of Service and applicable law.

What is the content policy?+

NamiFusion is an unfiltered engine: no arbitrary restrictions and NSFW-friendly, but illegal content and non-consensual use of real people are prohibited — see the Terms of Service.

How long does a OpenAI GPT Image 2 Text-to-Image task take?+

It depends on parameters — images usually take seconds, videos tens of seconds to minutes. The API returns a task_uuid for polling.

What are the resolution and duration limits?+

See the parameter table above — each model lists its available resolution and duration options there and in the playground.