od OpenAI

Model precyzyjny OpenAI: stabilne detale przy edycji, do 4K

openai/gpt-image-2.6-sunburst/text-to-image
GPT Image 2.6 Sunburst: generator obrazów AI online
  • Do 4K
  • Do 16 obrazów referencyjnych
  • Proporcje obrazu: 15
  • Do 10 naraz
  • Utwórz obraz
  • Edytuj obraz

Wywołujesz go nazwą modelu openai/gpt-image-2.6-sunburst/text-to-image w POST /jobs/createTask, od 0,02232 USD.

Nazwa modeluopenai/gpt-image-2.6-sunburst/text-to-image
EndpointPOST https://api.popnow.ai/api/v1/jobs/createTask
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "openai/gpt-image-2.6-sunburst/text-to-image",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "aspect_ratio": "1:1",
    "resolution": "1k",
    "quality": "medium",
    "num_outputs": 1,
    "background": "auto"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

input jest zbudowany ze schematu poniżej, więc przechodzi walidację bez zmian. Zamień prompt i linki na własne.

Cena

OpcjaUSD za obraz
quality lowresolution 1K0,02232 USD
quality lowresolution 5120,027 USD
quality mediumresolution 1K0,03915 USD
quality lowresolution 2K0,04131 USD
quality lowresolution 7680,04392 USD
quality highresolution 1K0,04743 USD
quality mediumresolution 5120,04752 USD
quality highresolution 5120,05742 USD
quality mediumresolution 2K0,07299 USD
quality lowresolution 4K0,07479 USD
quality mediumresolution 7680,07776 USD
quality xhighresolution 1K0,08433 USD

Rozliczenie w USD · Wszystkie opcje i ceny: GET /models/openai/gpt-image-2.6-sunburst/text-to-image

Opłata zależy od tokenów użytych przez każde żądanie: 4,50 USD za 1 mln tokenów tekstu wejściowego, 7,20 USD za 1 mln tokenów obrazu wejściowego i 27,00 USD za 1 mln tokenów obrazu wyjściowego. Tabela podaje cenę obrazu kwadratowego na każdym poziomie, więc inne proporcje zwykle kosztują mniej. Przy kilku obrazach wyjściowych tokeny wejściowe liczą się dla każdego obrazu.

Limity

Rozdzielczości
1K · 2K · 4K · 512 · 768
Proporcje obrazu
1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +9
Wyników na wywołanie
1–10
Długość promptu (znaki)
5,000

Parametry

Te pola pochodzą z tego samego schematu, którym sprawdzamy każde żądanie. Pola spoza listy są odrzucane.

Niektóre pola zależą od siebie (na przykład potrzebna jest co najmniej jedna referencja). Dokładne reguły są w surowym schemacie na dole.

  • promptstringWymagane

    Opisz, co chcesz stworzyć.

    Zakres
    Liczba znaków: 1 – 5000
  • aspect_ratiostringOpcjonalne

    Kształt kadru: szeroki, kwadratowy albo pionowy.

    Domyślnie
    "1:1"
    Dozwolone wartości
    "1:1""16:9""9:16""4:3""3:4""3:2""2:3""21:9""9:21""2:1""1:2""3:1""1:3""5:4""4:5"
  • resolutionstringOpcjonalneZmienia cenę

    Wybierz dostępny rozmiar wyniku.

    Domyślnie
    "1k"
    Dozwolone wartości
    "1k""2k""4k""512""768"
  • qualitystringOpcjonalneZmienia cenę

    Wybierz jedno z ustawień jakości modelu.

    Domyślnie
    "medium"
    Dozwolone wartości
    "low""medium""high""xhigh""max"
  • reasoning_effortstringOpcjonalne

    Rozumowanie zużywa tokeny wyjściowe.

    Dozwolone wartości
    "low""medium""high"
  • num_outputsintegerOpcjonalneZmienia cenę

    Ile wyników zrobić naraz.

    Domyślnie
    1
    Zakres
    1 – 10
  • backgroundstringOpcjonalne

    Zachowaj, usuń lub zamień tło.

    Domyślnie
    "auto"
    Dozwolone wartości
    "auto""transparent""opaque"
  • output_formatstringOpcjonalne

    Format pliku wyniku.

    Domyślnie
    "png"
    Dozwolone wartości
    "png""jpeg""webp""gif"
  • frame_countintegerOpcjonalneZmienia cenę

    Ile klatek odtwarza GIF w pętli. Do 8 klatek liczy się jako jeden obraz, od 9 do 16 jako dwa.

    Zakres
    2 – 16
  • frame_duration_msintegerOpcjonalne

    Jak długo każda klatka GIF jest widoczna, w milisekundach.

    Zakres
    20 – 2000
  • output_qualityintegerOpcjonalne

    Jakość kompresji JPEG i WebP. Wyższa wartość zachowuje więcej szczegółów i tworzy większy plik.

    Zakres
    0 – 100
Surowy JSON Schema
{
  "type": "object",
  "required": [
    "prompt"
  ],
  "properties": {
    "prompt": {
      "type": "string",
      "maxLength": 5000,
      "minLength": 1,
      "description": "Describe the picture: subject, setting, light and any short text to render in quotes."
    },
    "quality": {
      "enum": [
        "low",
        "medium",
        "high",
        "xhigh",
        "max"
      ],
      "type": "string",
      "default": "medium",
      "description": "Rendering quality. Higher tiers add detail, time and cost."
    },
    "background": {
      "enum": [
        "auto",
        "transparent",
        "opaque"
      ],
      "type": "string",
      "default": "auto",
      "description": "Background treatment. Transparent needs PNG or WebP output."
    },
    "resolution": {
      "enum": [
        "1k",
        "2k",
        "4k",
        "512",
        "768"
      ],
      "type": "string",
      "default": "1k",
      "description": "Output size tier: 1k is about 1 megapixel, 2k about 3.7, 4k about 8.3. For GIF output use 512 or 768, the size of one frame."
    },
    "frame_count": {
      "type": "integer",
      "maximum": 16,
      "minimum": 2,
      "description": "Number of frames in a GIF, 2 to 16 (default 9). Every 8 frames are billed as one more frame sheet. Only with gif output."
    },
    "num_outputs": {
      "type": "integer",
      "default": 1,
      "maximum": 10,
      "minimum": 1,
      "description": "How many images to return, each billed separately."
    },
    "aspect_ratio": {
      "enum": [
        "1:1",
        "16:9",
        "9:16",
        "4:3",
        "3:4",
        "3:2",
        "2:3",
        "21:9",
        "9:21",
        "2:1",
        "1:2",
        "3:1",
        "1:3",
        "5:4",
        "4:5"
      ],
      "type": "string",
      "default": "1:1",
      "description": "Output aspect ratio."
    },
    "output_format": {
      "enum": [
        "png",
        "jpeg",
        "webp",
        "gif"
      ],
      "type": "string",
      "default": "png",
      "description": "File format of the returned images. gif returns an animated loop; describe the motion in the prompt."
    },
    "output_quality": {
      "type": "integer",
      "maximum": 100,
      "minimum": 0,
      "description": "Compression quality for JPEG and WebP output, from 0 to 100."
    },
    "reasoning_effort": {
      "enum": [
        "low",
        "medium",
        "high"
      ],
      "type": "string",
      "description": "How much the model plans the picture before drawing. Higher helps dense text and complex layouts and takes longer; the price does not change. Leave it unset for the model default (high)."
    },
    "frame_duration_ms": {
      "type": "integer",
      "maximum": 2000,
      "minimum": 20,
      "description": "How long each GIF frame stays on screen, 20 to 2000 milliseconds (default 200). Only with gif output."
    }
  },
  "additionalProperties": false,
  "allOf": [
    {
      "if": {
        "required": [
          "background"
        ],
        "properties": {
          "background": {
            "const": "transparent"
          }
        }
      },
      "then": {
        "properties": {
          "output_format": {
            "enum": [
              "png",
              "webp"
            ]
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "output_format"
        ],
        "properties": {
          "output_format": {
            "const": "gif"
          }
        }
      },
      "then": {
        "properties": {
          "resolution": {
            "enum": [
              "512",
              "768"
            ]
          },
          "background": {
            "enum": [
              "auto",
              "opaque"
            ]
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "output_format"
        ],
        "properties": {
          "output_format": {
            "enum": [
              "png",
              "jpeg",
              "webp"
            ]
          }
        }
      },
      "then": {
        "properties": {
          "resolution": {
            "enum": [
              "1k",
              "2k",
              "4k"
            ]
          }
        }
      }
    },
    {
      "if": {
        "required": [
          "resolution"
        ],
        "properties": {
          "resolution": {
            "const": "768"
          }
        }
      },
      "then": {
        "properties": {
          "frame_count": {
            "maximum": 12
          }
        }
      }
    }
  ]
}

Prawdziwy wynik z GPT Image 2.6 Sunburst

Prawdziwa chmurka unosząca się nad otwartym atlasem Clouds of the North Atlantic obok mosiężnej lupy i zasuszonej paproci
PromptOverhead editorial still life on a washed linen tablecloth: an open clothbound field guide titled "Clouds of the North Atlantic" lies beside a brass magnifying loupe and a pressed fern. A real cumulus cloud the size of a teacup hovers two fingers above the open page and casts a soft grey shadow on the paper. The left page carries a caption in small serif type that reads "Fig. 12 — Cumulus humilis, seen off the Faroe Islands, 6 June". Soft north-window daylight, visible paper fibres and linen weave, muted sage, cream and slate tones, shot on a 50mm lens.
To samo żądanie przez API
{
  "model": "openai/gpt-image-2.6-sunburst/text-to-image",
  "input": {
    "prompt": "Overhead editorial still life on a washed linen tablecloth: an open clothbound field guide titled \"Clouds of the North Atlantic\" lies beside a brass magnifying loupe and a pressed fern. A real cumulus cloud the size of a teacup hovers two fingers above the open page and casts a soft grey shadow on the paper. The left page carries a caption in small serif type that reads \"Fig. 12 — Cumulus humilis, seen off the Faroe Islands, 6 June\". Soft north-window daylight, visible paper fibres and linen weave, muted sage, cream and slate tones, shot on a 50mm lens.",
    "aspect_ratio": "4:5",
    "resolution": "1k",
    "quality": "high",
    "num_outputs": 1,
    "background": "auto"
  }
}

Odpowiedzi, odpytywanie i callbacki

Wszystkie modele działają tak samo: utwórz zadanie, a potem odpytuj je albo poczekaj na callback.

Najpierw cena

cURL
curl -X POST https://api.popnow.ai/api/v1/jobs/quote \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "openai/gpt-image-2.6-sunburst/text-to-image",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "aspect_ratio": "1:1",
    "resolution": "1k",
    "quality": "medium",
    "num_outputs": 1,
    "background": "auto"
  }
}'

Przed uruchomieniem wyślij tę samą treść żądania do POST /jobs/quote, aby zobaczyć szacowaną i maksymalną opłatę w USD. Wycena nie uruchamia zadania ani nie obciąża salda.

Przyjęte

HTTP
HTTP/1.1 202 Accepted

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "state": "queued"
  },
  "request_id": "req_example_create"
}

HTTP 202 oznacza przyjęcie zadania: maksymalna kwota w USD pozostaje zarezerwowana do rozliczenia. Po przyjęciu zadania rezerwujemy maksymalną kwotę wyceny na saldzie PopNow. Po zakończeniu naliczamy opłatę za rzeczywiste użycie, nie wyższą niż rezerwacja, i zwalniamy resztę. Jeśli zadanie się nie powiedzie, rezerwacja zostaje zwolniona.

Sprawdź status

cURL
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Odpytuj co kilka sekund, stopniowo wydłużając odstęp, i przestań, gdy state ma wartość succeeded, failed, canceled lub expired.

Gotowe zadanie

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "openai/gpt-image-2.6-sunburst/text-to-image",
    "state": "succeeded",
    "output": {
      "assets": [
        {
          "url": "https://cdn.popnow.ai/tasks/task_01k3m8x9q2z4v7n5p6r8s0t1w3/output.png?signature=FROM_RESPONSE",
          "expiresAt": "2026-10-17T12:20:00Z",
          "mime": "image/png",
          "width": 1024,
          "height": 1024
        }
      ]
    },
    "settled": true
  },
  "request_id": "req_example_record"
}

Pobierz plik z url przed expiresAt. Potrzebujesz później nowego linku? Poproś o niego przez POST /common/download-url.

Weryfikacja callbacku

Node.js
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const app = express();
// express.raw keeps the exact bytes that were signed; express.json would not match.
app.post("/hooks/popnow", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.header("X-Webhook-Timestamp");
  const signature = req.header("X-Webhook-Signature") ?? "";
  const body = JSON.parse(req.body.toString("utf8"));
  const taskId = body.data?.taskId ?? body.task_id;
  const digest = createHash("sha256").update(req.body).digest("hex");
  const expected = createHmac("sha256", process.env.POPNOW_WEBHOOK_SECRET)
    .update(`${taskId}.${timestamp}.${digest}`)
    .digest("base64");
  const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
  // Check the signature first, then reject anything older than five minutes.
  if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.status(401).end();
  res.status(200).end(); // answer fast, then fetch the task and store its files
});

Gdy ustawisz callBackUrl, wyślemy ci ukończone zadanie. Przed przetworzeniem zweryfikuj podpis na oryginalnej treści żądania.

Wysyłanie pliku lokalnego

cURL
curl -X POST https://api.popnow.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png", "bytes": 482113}'

# PUT the file bytes to data.uploadUrl with every header in data.headers, then commit it:
curl -X POST https://api.popnow.ai/api/v1/files/$FILE_ID/commit \
  -H "Authorization: Bearer $POPNOW_API_KEY"
# The commit returns a popnow://f/... reference. Put it in any image, video or
# audio field of the task input instead of a public https URL.

Publiczne linki https działają bez zmian. Pliki lokalne przechodzą najpierw przez upload-url i commit.