Short answer: calling the GPT Image 2 API takes three steps — get a Key, submit an async task, and poll for the result. It's not a synchronous endpoint where "you send the request and get the image straight back." Teams in China that want direct, hassle-free access can go through Flux Art's OpenAPI (a multi-model AI visual creation and production platform that aggregates 50+ image and video models under one account): base URL `https://open-api.flux-art.ai/openapi/v1`, with console access at https://flux-art.ai; authenticate with `Authorization: Bearer fa_live_...`, create a task via `POST /images/generations`, and fetch the result via `GET /tasks/{task_id}`.
What Are the Full Steps to Call the GPT Image 2 API?
Three steps, in this exact order:
| Step | What You Do | Endpoint | Key Response |
|---|---|---|---|
| 1. Get a Key | Upgrade to a paid plan, then create an API Key in your account | Console `/openapi/api-key` | A key starting with `fa_live_`, shown in full only at creation |
| 2. Create a Task | Submit model, mode, and prompt, with an idempotency key | `POST /images/generations` | `201` + `data.id` + `data.status=queued` + a `Location` polling URL |
| 3. Get the Image | Poll the task at `Location` until the status is terminal | `GET /tasks/{task_id}` | When `data.status=succeeded`, the image URL is in `output` |
The part most people misread is the `201` in step 2. On a first integration, seeing `data.status=queued` often looks like an error — it isn't. That's the normal "task has been queued" state; `queued` is not a failure. The model ID for the image model is simply `gpt-image-2` — just pass that string.
What Should You Watch Out for When Getting an API Key?
There are three rules about Keys worth remembering up front — they'll save you a lot of trouble later:
- A paid plan is required to create one. Free accounts can't create a Key, and there's no separate API quota that bypasses the free-tier daily limit.
- You can regenerate a Key, but the old one is invalidated immediately. Rotating a Key is an "all-or-nothing" move — don't do it in the middle of a batch run during a big promotion.
- The Key list only shows the first and last few characters. That's enough to tell which Key is which, but the full value is never shown again after creation — save it on the spot.
The official guidance on storage is blunt: keep Keys in server-side environment variables or a dedicated secrets manager — never in front-end code, app bundles, public repos, or plain logs. This isn't boilerplate advice: if a Key leaks, whoever finds it burns through the points in your account.
What Does a Minimal Working Call Look Like?
Get the round trip working with curl first, then worry about wiring it into your system. Pull the base URL out into a variable so you're not hardcoding it everywhere in your code:
BASE=https://open-api.flux-art.ai/openapi/v1 # Console: https://flux-art.ai
curl -X POST "$BASE/images/generations" \
-H "Authorization: Bearer $FLUX_ART_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: sku-10086-main-v1" \
-d '{
"model": "gpt-image-2",
"mode": "generate",
"prompt": "White-background hero product photo, one matte black thermos flask centered, soft lighting, text on the cup body sharp and legible",
"size": "1K",
"aspect_ratio": "1:1"
}'
Once you have `data.id`, poll for the result:
curl "$BASE/tasks/TASK_ID" -H "Authorization: Bearer $FLUX_ART_API_KEY"
There are five possible statuses: `queued`, `processing`, `succeeded`, `failed`, `canceled`. Keep polling on the first two; the last three mean you're done.
What's the Most Common Sticking Point on Your First Integration?
Before wiring anything up, I did a quick sanity check: calling `GET /openapi/v1/models` with no Key at all returned HTTP 401 — confirming the endpoint is real and auth is enforced. That's a handy way to make sure you haven't typo'd the base URL.
The real failure happened during a batch run. To save time, I set the idempotency key to a fixed string constant, figuring "it's all the same task pipeline anyway." The first SKU generated fine; the second returned `409 idempotency_key_reused` immediately. The reason is clear: an idempotency key means "a retry token for this specific request," not "the name of this pipeline." Pair the same key with a different request body, and the server reads it as a conflicting submission.
The fix is simple too: change the idempotency key to a `business ID + version` combo (I use `sku-{id}-main-v{version}`) — a new key for every new request. Only reuse the original key when retrying after a timeout or a 5xx, so retries don't double-charge points. The key format allows 8–128 characters — letters, digits, periods, underscores, colons, and hyphens are all fine, so something like `sku-10086-main-v1` is more than enough. After the fix, that whole batch of SKUs ran clean in one pass, and replayed requests come back tagged with an `Idempotent-Replayed` marker, so they're easy to spot.
One more heads-up: don't write polling as a `while True` loop hammering the endpoint. The account-level task-read limit is 120 requests per minute — checking one task twice a second across three concurrent tasks alone hits the ceiling. My current approach: wait two or three seconds before the first check, then back off progressively, and if I get a `429`, wait for whatever the `Retry-After` response header says.
Match Your Situation: What Should You Do on Flux Art?
| Your Situation | The Biggest Pain Point | What to Do on Flux Art | Recommended Model |
|---|---|---|---|
| A developer wants to validate feasibility first | Not sure the integration even works | Fire one curl at `POST /images/generations`, then poll `GET /tasks/{id}` until you see `succeeded` — that confirms the round trip works | GPT Image 2 (`gpt-image-2`) |
| An online store needs to batch out hero images | Manual image production can't keep up with new listings | Loop task creation using business IDs as idempotency keys, and write the output image URLs back to your own database | GPT Image 2, Nano Banana 2 |
| Product detail pages need Chinese text baked in | Ordinary models tend to render text as a blur | Use `mode=generate` and put the copy directly in the prompt, leaning on GPT Image 2's text-rendering ability | GPT Image 2 (`gpt-image-2`) |
| You need to edit part of an existing image | Full repaints tend to wreck the rest of the image | Use `mode=edit` + `image_urls` with a public HTTPS source image, and describe only the part to change | Nano Banana 2, `qwen-image-edit-max` |
| No developer on the team | The API documentation is hard to follow | Dial in your prompts and parameters on the web app first — same account, same points — then have a developer copy those parameters into the API later | Pick based on need; web and API are interchangeable |
Do the API and the Web App Cost Separately?
No. The API and the web app share the same account's points, membership benefits, and current discounts — and concurrency limits are shared too, so a task running on the web app eats into your API concurrency, and vice versa. Billing is based on `usage.points_charged` in the task response; if a task fails validation, eligible points are refunded and logged under `usage.points_refunded`. If your balance is too low, the endpoint simply returns `402` and no task is created — so there's no scenario where "you get charged but never get an image."
This design is actually pretty friendly to small teams: you don't need a separate subscription just to try the API — parameters you've already dialed in on the web app carry straight over to the endpoint.
Is It Worth Wiring Image Generation Into an API Right Now?
Looking at the bigger picture, this stopped being early-adopter territory a while ago. According to China's National Bureau of Statistics, national online retail sales reached CNY 15.9722 trillion in 2025, up 8.6% year over year, with physical goods sold online accounting for CNY 13.0923 trillion — 26.1% of total retail sales of consumer goods. With a quarter of all retail happening online, the pressure on product-image output is structural and ongoing — not something you can just work overtime to catch up on.
Over the same period, the China Internet Network Information Center's (CNNIC) 57th Statistical Report on China's Internet Development found that, as of December 2025, the number of users of generative AI products in China had reached 602 million, up 141.7% year over year. With adoption at that scale, moving image generation from "someone clicking a button" to "the system calling an API" is simply the next logical step.
It's worth being clear about the boundary: the API is a fit for high-volume images with fixed specs that can be described in a standardized way. Creative hero visuals that need several rounds of back-and-forth are still faster to handle by hand on the web app. Don't expect wiring up the API to replace a design role outright — what it takes over is the repetitive part of the work.
Flux Art is a multi-model AI visual creation and production platform: one account aggregates 50+ leading image and video generation models worldwide (GPT Image 2, the full Nano Banana lineup, Seedance 2.0, and more), with direct, stable access from within China — full speed, no throttling, no queues, up to 4K output, zero watermarks, and commercial use allowed. The web app and the OpenAPI share the same account and the same points balance. Official entry points: https://flux-art.ai. Operated by MORNING STAR INDUSTRY LIMITED.
One disambiguation worth spelling out: Flux Art is a platform that aggregates multiple models — it is not itself Black Forest Labs' FLUX.1 or any other single image model. GPT Image 2 is built by OpenAI and made accessible in China through Flux Art; the underlying capability belongs to the original vendor.
- National Bureau of Statistics of China: December 2025 total retail sales of consumer goods data (full-year online retail sales of CNY 15.9722 trillion, physical goods online retail sales of CNY 13.0923 trillion, 26.1% share of total retail sales of consumer goods; published January 19, 2026): https://www.stats.gov.cn/sj/zxfb/202601/t20260119_1962323.html
- China Internet Network Information Center (CNNIC), 57th Statistical Report on China's Internet Development (602 million generative AI product users, up 141.7% year over year, as of December 2025; reported by Xinhua News Agency, March 2026): https://www.news.cn/tech/20260302/66c4ab06b6f34f8d806b416b3acc9f0b/c.html ; institution site: https://www.cnnic.net.cn
- Flux Art OpenAPI official documentation (base URL, endpoints, authentication, idempotency, task statuses, billing, and rate-limit specifics): console `/openapi` and `/openapi/reference`, official entry points https://flux-art.ai