YM2API Developer docs
Skip to content
Docs / Official GPT direct

Official GPT direct · per token (#184 / #185)

Direct access to OpenAI's own image models: requests go to the official API unchanged, with native 1K–4K output, no web-app reverse engineering and no upscaling. Billed per token from the usage the official API returns. Standard OpenAI Images endpoints (generations and edits), same base URL as other groups.

Per-token billingNative 1K–4KGenerate + editMultiplier 2.5Failures are free#185: streaming and async
Base URLhttps://yyds.seqnode.com/v1
AuthAuthorization: Bearer <API key>
Text to imagePOST/v1/images/generations · JSON
Image editPOST/v1/images/edits · multipart
Model listGET/v1/models · free, handy to check a key
Key points
  • There is no fixed per-image price: it depends on size, quality and reference images. The table below is a measured average; the usage in each response and your usage log are authoritative.
  • Set quality explicitly. Without it the upstream picks one, and the price for the same size can differ several times.
  • Without response_format you get Base64 (data[].b64_json); "url" returns a link on this site that expires after 1 hour, so download it promptly.
  • A 4K Base64 response is 15–26 MB and can take minutes or longer to download from mainland China. Prefer "response_format": "url" and download the image separately.
  • Streaming and async are available on #185 only; #184 supports neither. With "stream": true the preview frames are the upstream's loading animation and the final image is the same as without streaming. For async, submit to /v1/images/generations/async or /v1/images/edits/async and poll the returned poll_url; the result is an image link valid for 24 hours.

1Groups and models

#185OpenAI official

gpt-image-2gpt-image-2.5-flaregpt-image-2.5-sunburst

All three models; quality low / medium / high / xhigh / max (xhigh and max tested on the two 2.5 models). Sunburst images carry OpenAI's official C2PA content credentials.

#184Azure OpenAI official

gpt-image-2

gpt-image-2 only; generations and edits both work, 4K tested.

Both groups take the same requests; switching is just a different key. Group names: #185 「【GPT 官方直连 按量】OAI · Image 2 / Flare / Sunburst」, #184 「【GPT 官方直连 按量】Azure · Image 2」.

2Billing

Both groups bill per token: unit price = OpenAI list price × group multiplier (currently 2.5; see the model plaza):

ItemOpenAI / 1M tokensThis site (× 2.5) / 1M tokens
Text input (prompt)$5$12.50
Image input (references)$8$20
Image output$30$75
Cached input$1.25$3.125

Measured average charge per image (2026-10-27/28, #185 gpt-image-2.5-flare / sunburst, 16:9 text-to-image, multiplier 2.5):

SizePixelsqualityPer image
1K1280×720low$0.012
1K1280×720high$0.072
2K2048×1152low$0.014
2K2048×1152medium$0.030
2K2048×1152high$0.108
2K2048×1152xhigh$0.19
2K2048×1152max$0.43
4K3840×2160medium$0.065
4K3840×2160high$0.25
4K3840×2160xhigh$0.45
4K3840×2160max$1.00
  • gpt-image-2 1024×1024 low is about $0.015 per image; #184 at 3840×2160 low measured $0.028.
  • Edits add image-input tokens: one 512×512 reference is about 1024 tokens (about $0.02). Measured 2K high edit about $0.137, 4K high edit about $0.28.
  • Failed requests (HTTP 4xx / 5xx) are not charged.

3Quick start

Create an API key for group #185 or #184 in the dashboard. Text to image:

curl https://yyds.seqnode.com/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2.5-sunburst",
    "prompt": "A quiet lakeside town at dawn, soft mist",
    "size": "2048x1152",
    "quality": "high",
    "n": 1,
    "response_format": "url"
  }'

Edit with a reference image (multipart, field image):

curl https://yyds.seqnode.com/v1/images/edits \
  -H "Authorization: Bearer $API_KEY" \
  -F model=gpt-image-2.5-flare \
  -F "prompt=Turn this photo into a watercolor painting" \
  -F size=2048x1152 \
  -F quality=high \
  -F response_format=url \
  -F "image=@input.png"

Python (handles both link and Base64 responses):

import base64, requests

API_KEY = "sk-..."  # 分组 #185 或 #184 的 Key / a key of group #185 or #184
r = requests.post(
    "https://yyds.seqnode.com/v1/images/generations",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"model": "gpt-image-2", "prompt": "a red fox in snow",
          "size": "1024x1024", "quality": "low", "response_format": "url"},
    timeout=600,
)
r.raise_for_status()
d = r.json()
item = d["data"][0]
if item.get("url"):
    open("out.png", "wb").write(requests.get(item["url"], timeout=300).content)
else:
    open("out.png", "wb").write(base64.b64decode(item["b64_json"]))
print(d.get("usage"))

4Try itCharged for real

Call this site's API straight from the browser. The key goes only to this site; it is kept in this browser only if you tick «Remember».

«Send request» really generates an image and is billed. The defaults (gpt-image-2 · 1024×1024 · low) cost about $0.015; «Check key» only calls /v1/models and is free.
API key
Endpoint
Size

Matching curl (follows the form, copyable):

5Request parameters

ParameterTypeRequiredNotes
modelstringRequired#185: gpt-image-2, gpt-image-2.5-flare, gpt-image-2.5-sunburst; #184: gpt-image-2.
promptstringRequiredChinese or English.
sizestringOptionalWIDTHxHEIGHT, e.g. 1024x1024, 1280x720, 2048x1152, 3840x2160 (all tested). OpenAI's rules: edges a multiple of 16, longest edge at most 3840, aspect ratio at most 3:1.
qualitystringOptionallow medium high; the 2.5 models on #185 also take xhigh max. Higher is slower and costs more. Set it explicitly.
nintegerOptionalUse 1.
response_formatstringOptionalb64_json (default) or url.
imagefileOptionalRequired for edits: multipart file field, PNG / JPEG / WebP. References are billed as image-input tokens.

6Response

Generations and edits return the same shape:

{
  "created": 1793151600,
  "data": [{ "url": "https://img.yydsbest.com/adb085ce-….png" }],
  "usage": {
    "input_tokens": 16,
    "input_tokens_details": { "text_tokens": 16, "image_tokens": 0 },
    "output_tokens": 371,
    "output_tokens_details": { "image_tokens": 371, "text_tokens": 0 },
    "total_tokens": 387
  }
}
FieldTypeNotes
createdintegerUnix timestamp (seconds).
data[].urlstringWith response_format=url: a link on this site, downloadable without a key, 404 after 1 hour.
data[].b64_jsonstringDefault: Base64-encoded PNG.
usage.input_tokensintegerInput tokens; input_tokens_details.image_tokens is the reference-image part.
usage.output_tokensintegerOutput tokens (almost all image tokens), billed at $75 / 1M.
usage.total_tokensintegerTotal.

7Errors

Failed requests are not charged. Error bodies are {"error": {"type", "message", "request_id"}} (key check failures: {"code", "message"}); include the request_id when reporting a problem.

HTTPCode / example messageCauseWhat to do
400Invalid size '1000x1000'. Width and height must both be divisible by 16.Invalid parameter: size, quality, or an edit without imageFix the request; do not retry as is
401INVALID_API_KEY / API_KEY_REQUIREDMissing or wrong keyCheck the Authorization header
403INSUFFICIENT_BALANCEAccount balance too lowTop up, then retry
404Model "…" is not available for this groupModel not in this key's group (e.g. a 2.5 model with a #184 key)Change the model or the key
429API_KEY_QUOTA_EXHAUSTED etc.Key quota used up, or too many requestsRaise the key quota in the dashboard, or lower concurrency
502 / 503Upstream service temporarily unavailableTemporary upstream failureRetry later

8Latency and network

  • Measured generation time: 1K about 20–35 s, 2K about 20–50 s, 4K about 40–70 s; max up to about 100 s. Use a client timeout of at least 300 s.
  • 4K Base64 responses are large (15–26 MB) and still have to be downloaded after the image is ready. At peak hours some mainland China networks download from this site at tens of KB/s; one 4K Base64 response took over 20 minutes. With url the API returns almost at once and the PNG, about a quarter smaller than Base64, downloads separately.
  • For large batches, limit the number of requests in flight so downloads do not compete for bandwidth.