KovAPIKovAPI
gpt-image-2.6-sunburst-token

GPT Image 2.6 Sunburst · Token · API

POST https://kovapi.com/v1/images/generations

GPT Image 2.6 Sunburst, billed by tokens: the same model as gpt-image-2.6-sunburst, billed on the token usage OpenAI reports, at 72% of the official rates. Quality xhigh and max are available and moderation: low takes effect; 1K / 2K / 4K, 15 ratios, the original image as generated, nothing charged on failure. GIF output is not available yet. Jobs queue at busy times.

Try in Playground →

Quick start

Three steps: submit a job, poll it, take the image link. Replace YOUR_API_KEY with your key and the commands below run as they are.

Step 1 · Submit (returns a job id at once, HTTP 202)

curl
curl https://kovapi.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-image-2.6-sunburst-token", "prompt": "An oil painting of a harbour at dusk, visible brushstrokes, warm palette", "size": "16:9", "resolution": "2K"}'

Response (HTTP 202)

JSON
{
  "id": "img_7f3c9a1e2b4d6f8a0c1e3b5d",
  "object": "image.generation.job",
  "status": "queued",
  "created": 1791281400,
  "model": "gpt-image-2.6-sunburst-token"
}

Step 2 · Poll every 2–3 seconds until status is succeeded or failed

curl
curl https://kovapi.com/v1/images/jobs/img_7f3c9a1e2b4d6f8a0c1e3b5d \
  -H "Authorization: Bearer YOUR_API_KEY"

Response when it succeeds

JSON
{
  "id": "img_7f3c9a1e2b4d6f8a0c1e3b5d",
  "object": "image.generation.job",
  "status": "succeeded",
  "created": 1791281400,
  "model": "gpt-image-2.6-sunburst-token",
  "data": [
    {"url": "https://img.kovapi.com/i/2be8cd16d37f3a4b9c0e1f2a3b4c5d6e.png"}
  ],
  "usage": {"images": 1, "resolution": "2K", "model": "gpt-image-2.6-sunburst-token"}
}

Step 3 · data[0].url is the image (PNG). It is kept for 15 days; download it to your own storage to keep it longer.

Complete example (Python: submit, wait, save to disk)

Python
import time
import requests

BASE = "https://kovapi.com/v1"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

# 1. submit
job = requests.post(f"{BASE}/images/generations", headers=HEADERS, json={
    "model": "gpt-image-2.6-sunburst-token",
    "prompt": "An oil painting of a harbour at dusk, visible brushstrokes, warm palette",
    "size": "16:9",
    "resolution": "2K",
}).json()
if "error" in job:
    raise SystemExit(job["error"]["message"])

# 2. poll every 3 seconds until it finishes
while job["status"] not in ("succeeded", "failed"):
    time.sleep(3)
    job = requests.get(f"{BASE}/images/jobs/{job['id']}", headers=HEADERS).json()

# 3. download the image
if job["status"] == "succeeded":
    url = job["data"][0]["url"]
    with open("gpt-image-2.6-sunburst-token.png", "wb") as f:
        f.write(requests.get(url).content)
    print("saved", url)
else:
    print("failed:", job["error"]["code"], job["error"]["message"])

Authentication

Header
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Create an API Key in the console to start.

Request parameters

The JSON body of POST /v1/images/generations:

ParameterTypeRequiredDescription
modelstringYesThe model id: gpt-image-2.6-sunburst-token.
promptstringYesWhat to draw. For image-to-image, say what to change.
sizestringNoRatio, one of the 15 in the table, e.g. 16:9; or a pixel size, or auto (with references, follow the first reference's ratio). Without it the image is 1:1.
resolutionstringNoTier: 1K (default), 2K or 4K.
qualitystringNoQuality: low, medium (default), high, xhigh, max or auto (the model decides). Higher quality uses more tokens: at the same size about 0.57 / 1 / 1.21 / 2.1 / 4.8 times medium.
image / imagesstring / arrayNoReference images; sending one makes it image-to-image: image for one, images for several (up to 16). Public image links, data: URIs or base64.
nintegerNoNumber of images. Best left out: for several images submit several jobs at once. With n, n images are held up front and the images actually delivered are billed.
callback_urlstringNoWhere to push the result when the job ends; see Webhooks below.
complexitystringNoPlanning depth: low, medium or high. It has no effect on the token-billed version yet (sending it is not an error) and does not change the price.
moderationstringNoModeration strictness: auto (default) or low (less strict, still within OpenAI's content policy).
output_compressionintegerNoCompression, a whole number 0-100, for jpeg / webp output only; lower means a smaller file.
mask_urlstringNoMask for a regional edit: a PNG the same size as the first reference, transparent where the change goes. Needs a reference; cannot be combined with markup_url. The model follows the mask as guidance, not as a hard boundary.
markup_urlstringNoMarkup layer: a transparent PNG with circles or marks where the change goes, laid over the first reference; say in the prompt what to do, e.g. "make the vase in the red circle blue and remove the circle". Needs a reference; cannot be combined with mask_url; up to 16.77 megapixels.

background may be transparent (pair it with PNG or WebP output); output_format is png (default), jpeg or webp. n must be 1. A parameter not listed here returns 400 unsupported_image_parameter at submit and nothing is charged; the result comes back as url, and usage carries this job's tokens and charge.

Billed by tokens

At submit, an upper bound is held from the size, quality and number of references; after the image is made the job settles on the usage OpenAI reports, and the rest of the hold is returned at once; a failure is refunded in full. Prices per 1M tokens:

ItemOur priceOpenAI list price
Image output$21.6$30
Image input (references)$5.76$8
Text input$3.6$5

Measured output tokens and cost (input not included)

sizequalityoutput tokensUSD
1024x1024low824$0.018
1024x1024medium1,449$0.031
1024x1024high1,758$0.038
1024x1024xhigh3,122$0.067
1024x1024max7,024$0.152
2048x2048medium2,944$0.064
2048x2048max14,272$0.308
3840x2160medium2,855$0.062
3840x2160max13,342$0.288
3840x1280medium1,096$0.024

For the same size and quality the output tokens are the same every time, whatever the prompt; each reference adds about 700-1,600 image input tokens.

Aspect ratio, resolution and output size

Put the ratio in size and the tier in resolution. You get the original image as generated, neither cropped nor resized, at the sizes below: both sides are multiples of 16, and 4K stays within 3840 px a side and about 8.3 megapixels.

Aspect ratio1K2K4K
1:11024x10242048x20482880x2880
3:4768x10241536x20482480x3312
4:31024x7682048x15363312x2480
2:3672x10241360x20482336x3520
3:21024x6722048x13603520x2336
9:16608x10881152x20482160x3840
16:91088x6082048x11523840x2160
4:5816x10241632x20482576x3216
5:41024x8162048x16323216x2576
1:2576x11521024x20481920x3840
2:11152x5762048x10243840x1920
9:21544x1264880x20481648x3840
21:91264x5442048x8803840x1648
1:3480x1440672x20161280x3840
3:11440x4802016x6723840x1280
  • The 15 ratios in the table are supported; any other ratio returns 400 at submit and nothing is charged. With size set to auto and a reference image, the picture follows the ratio closest to the first reference; without one it is 1:1. A few long, narrow ratios at 1K are below the model's minimum pixel count and render at the enlarged sizes in the table (16:9 is 1088×608).
  • size may also be a pixel size (e.g. 1536x1024) in one of the 15 ratios: width and height are rounded down to multiples of 16, scaled down when above the tier's limit and scaled up to the model's minimum (about 655,000 pixels) when too small. The tier comes from resolution; without it, from the long side: up to 1536 is 1K, up to 2048 is 2K, larger is 4K. Long-side ranges: 1K 512-1536, 2K 2016-2304, 4K 2049-4096; outside them the request returns 400 at submit and nothing is charged.

Quality and native resolution

  • Without quality the image renders at medium. Quality changes only the tokens and the price, never the size; with auto the model decides, the hold assumes max, and the job settles on the real usage.
  • If quality holds 1K, 2K or 4K and resolution is not given, it is read as the resolution tier (size and price follow that tier).
  • At busy times jobs wait in the queue instead of failing at once; if no image comes after a long wait (about 15 minutes) the job fails and is refunded in full, and you can resubmit it as is.

Image-to-image and reference images

  • Send image (one) or images (several, up to 16; any beyond that are not used) for image-to-image, and say in the prompt what to change. POST /v1/images/edits takes the same parameters.
  • Both endpoints take a JSON body only, not a multipart file upload, so the OpenAI SDK's images.edit() cannot be used as is: pass links or base64 as in the example below.
  • Each reference may be a public image link (http / https), a data: URI or plain base64, up to 16 MB, in PNG, JPEG or WebP; a reference in any other format fails the job and the hold is refunded in full.
  • A URL has to download the image itself: not a web page, and not behind a login or hotlink protection. A reference we cannot read is refused at submit with a 400 that says which one and why; no job is created and nothing is charged.
  • The output ratio comes from size, not from the reference. To keep the original ratio, set size to it.
  • We host the references for you and keep them for 7 days.

Image-to-image with two references

curl
curl https://kovapi.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-image-2.6-sunburst-token", "prompt": "Keep the people, change the background to a beach at night with warm string lights", "images": ["https://example.com/people.jpg", "https://example.com/beach.jpg"], "size": "3:4", "resolution": "2K"}'

Job status and fields

GET /v1/images/jobs/{id} reports these statuses; every field is described in Async jobs. Poll every 2–3 seconds, or use a webhook.

StatusMeaning
queuedWaiting in line. Carries queue_position (jobs ahead of yours) and eta_seconds (expected wait).
processingRendering.
succeededDone. The result is in data[0].url, the billing detail in usage.
failedFailed. The reason is in error; the credits held for the job are refunded in full.

One account runs up to 50 jobs at a time; further jobs wait in submission order, and a job that has not started after 15 minutes fails and is refunded in full. Job records are kept for 3 days and image links for 15 days.

How long it takes

Usually 20–60 seconds from submit to result; 4K, edits with several references and busy periods take longer, and an occasional job takes a minute or two.

Errors and refunds

An error at submit comes back at once as HTTP 4xx / 5xx: no job is created and nothing is charged. A failure after the job was accepted is reported by the job endpoint, and the hold is refunded in full. Every code is listed under Error codes.

Errors at submit

HTTPcodeCauseWhat to do
400missing_prompt/v1/images/generations has no prompt.Add a prompt.
400invalid_requestA reference image cannot be read (dead link, not an image, over 16MB...; message says which one and why), /v1/images/edits has no reference image, the body is not a JSON object, or n is not an integer.Fix what message says and submit again.
400model_not_foundThe model id is misspelled, model is missing, or the model cannot be used on this endpoint (a chat model on the image endpoint, for example).Use a model id from GET /v1/models or the API reference.
401invalid_api_keyThe key does not exist, was deleted or is disabled, or the account is disabled.Check the key on the API Keys page of the console.
402insufficient_quotaNot enough balance to hold this request. The gateway holds the highest possible cost of the request first, so a burst of concurrent calls can trigger it too.After a burst, wait a few seconds and retry; otherwise top up.
429rate_limit_exceededOver the requests-per-minute limit set on this key (counted over the last 60 seconds). No Retry-After header.Wait a few seconds and retry, or raise the key's limit in the console.
503model_maintenanceThe model is under maintenance and takes no requests; no other model answers in its place meanwhile.Retry when maintenance ends; see Status.
503service_unavailableA temporary failure on our side, such as storing a reference file; /v1/responses also answers 503, with Retry-After, when it cannot take requests for a moment.Retry shortly.

Failed jobs (status failed)

codeWhen you see itWhat to do
moderation_blockedImage: the model provider's safety system refused the prompt or a reference image (the code may also be content_policy_violation).Rewrite the prompt or replace the reference; resubmitting it unchanged is usually refused again.
upstream_errorAny other failure: the automatic retries did not help, the job waited 15 minutes without starting, the upstream refused without a reason, and so on; message says which.Submitting again usually works.

Webhooks instead of polling

Add callback_url when you submit and the moment the job ends, success or failure, the gateway pushes exactly what the poll endpoint returns to that URL, signed and retried on failure. You can also set an account-wide address under Settings → Webhook in the console. Webhook docs →

curl · callback_url
curl https://kovapi.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-image-2.6-sunburst-token", "prompt": "An oil painting of a harbour at dusk, visible brushstrokes, warm palette", "size": "1:1", "callback_url": "https://your-domain.com/webhook"}'