Short answer: Don’t treat every “GPT Image 2 API” example as an OpenAI API integration. The detailed request-and-polling example below is for WaveSpeed’s hosted API and uses a WaveSpeed API key. OpenAI’s latest announcement, dated November 4, 2026, describes GPT‑Image‑2.6 Flare and Sunburst as API models. The official material captured for this guide does not establish the current OpenAI-direct endpoint, authentication, or request schema for the older name gpt-image-2. (openai.com)
Which API route does this guide cover?
There are two claims to keep separate:
- OpenAI-direct: A MindStudio article reported that
gpt-image-2was available in OpenAI’s API in April 2026. That is a third-party report, not the direct API documentation needed to confirm the current model ID, endpoint, or request format. OpenAI’s later announcement identifies GPT‑Image‑2.6 Flare and Sunburst as API models. (openai.com) - WaveSpeed-hosted: The WaveSpeed model page documents a text-to-image endpoint on
api.wavespeed.ai, authenticated with a WaveSpeed API key. The integration below describes that provider’s route—not an OpenAI endpoint or OpenAI credential flow.
If you specifically need OpenAI-direct access, use OpenAI’s current API documentation to select the available model and confirm its endpoint and parameters before coding. Do not substitute WaveSpeed’s URL or key.
WaveSpeed quick start: submit a prompt and poll for the result
Prerequisites: a WaveSpeed API key, Node.js with built-in fetch support (Node 18 or later), and the key stored in the WAVESPEED_API_KEY environment variable. The example follows the request and response fields shown in WaveSpeed’s documentation; it has not been independently tested here.
const apiKey = process.env.WAVESPEED_API_KEY;
if (!apiKey) throw new Error("Set WAVESPEED_API_KEY");
const base = "https://api.wavespeed.ai/api/v3";
const headers = {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
};
async function requestJson(url, options = {}) {
const response = await fetch(url, options);
if (!response.ok) throw new Error(await response.text());
return response.json();
}
// Submit an image-generation task.
const submitted = await requestJson(
`${base}/openai/gpt-image-2/text-to-image`,
{
method: "POST",
headers,
body: JSON.stringify({
prompt: "A cinematic city skyline at sunset, soft golden light",
aspect_ratio: "1:1",
resolution: "1k",
quality: "medium",
output_format: "png",
}),
}
);
const task = submitted.data ?? submitted;
if (!task.id) throw new Error("Submission response did not contain an id");
// Poll the prediction until it completes or reaches a terminal error status.
const resultUrl = `${base}/predictions/${task.id}/result`;
while (true) {
const response = await requestJson(resultUrl, { headers });
const result = response.data ?? response;
if (result.status === "completed") {
console.log("Generated image output:", result.outputs);
break;
}
if (["failed", "cancelled", "timeout", "deleted"].includes(result.status)) {
throw new Error(JSON.stringify(result));
}
await new Promise(resolve => setTimeout(resolve, 2000));
}
Expected flow: the POST returns a prediction ID; the client polls the corresponding result URL; when the status is completed, the documented example reads outputs. The captured page does not include a complete response example or define the exact contents and lifetime of each output value. Check the current WaveSpeed reference before building downstream image downloading or storage around a presumed output format. Its quick start suggests beginning with polling around every two seconds and increasing the interval for longer-running tasks.
WaveSpeed request fields
The captured WaveSpeed page identifies prompt as the only required field. It lists these optional settings:
| Field | Documented values or default |
|---|---|
aspect_ratio |
1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
resolution |
1k (default), 2k, 4k |
quality |
low, medium (default), high |
output_format |
The example uses png; the captured parameter table does not specify its full allowed values or default. |
These are provider-page details, not confirmed OpenAI-direct parameters. For a prompt, describe the subject and composition clearly; if the image needs particular wording, include the exact text. That can guide generation, but it does not guarantee typo-free text in the final image.
WaveSpeed pricing and production caveats
The WaveSpeed page displays $0.057 per run and separately lists these prices by quality and resolution:
| Quality | 1k | 2k | 4k |
|---|---|---|---|
| Low | $0.01 | $0.02 | $0.03 |
| Medium | $0.06 | $0.10 | $0.18 |
| High | $0.22 | $0.40 | $0.72 |
The page uses the $ symbol but does not explicitly identify the currency in the captured text. Its headline $0.057 per run also differs from the table’s $0.06 for medium/1k. An FAQ says “per run or per second,” which conflicts with the per-run headline and quality/resolution table. The page warns that documentation prices may be outdated and that the final task charge prevails. Treat these figures as reported reference prices, not a reconciled or guaranteed quote; confirm the live charge and billing unit with WaveSpeed before estimating a production budget. They are not OpenAI-direct API prices.
The same page reports generation time of about 32 seconds per request, but labels this an estimate rather than a latency guarantee. The captured material does not establish rate limits, concurrency limits, retention or output-link lifetime, an SLA, or commercial-use rights. Confirm those terms with the relevant provider before relying on them in a production design.
Bottom line
For an OpenAI-direct integration, verify the current model and API schema in OpenAI’s documentation; the latest official announcement captured here names GPT‑Image‑2.6 Flare and Sunburst, but does not provide the implementation details needed for a direct request. For the concrete flow shown above, use WaveSpeed’s endpoint and key, and treat its parameters and prices as WaveSpeed-specific. Never pass third-party endpoint, credential, or pricing details off as OpenAI-direct instructions.
Sources
Introducing Images 2.6 — OpenAI
Introducing ChatGPT Images 2.5 — OpenAI
GPT Image 2 Text to Image API — WaveSpeed
What is GPT Image 2? OpenAI’s newest image model — MindStudio
