{"openapi":"3.0.2","info":{"title":"openai/gpt-image-1.5","description":"The request body Comfy Router accepts for the model \"openai/gpt-image-1.5\", and the response body it returns. The INPUT schema is the same schema the server validates a call against before it reaches the provider, so what is published and what is enforced cannot differ. `x-comfy-router-input-modalities` records the media kinds the model is documented to accept; the request schema is shared across sibling models and may admit media kinds this model ignores. The OUTPUT schema describes the provider's native result document exactly as Router returns it: Router does not validate, narrow or re-envelope the response, so the output schema is descriptive rather than enforced, and Comfy owns no output shape of its own.","version":"19dae7ccb496"},"paths":{"/v2/models/openai/gpt-image-1.5":{"post":{"operationId":"runRouterModel","summary":"Run openai/gpt-image-1.5 synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"The request body for a gpt-image model. ONE model id reaches TWO upstream OpenAI operations and this body is what selects between them: OMIT `image` for text-to-image generation, INCLUDE it to edit the image you send. The example below is the generation call; adding `image` to it is the whole of the structural difference, and `image`'s own description carries a copyable edit body.\nSVG and animated GIF output are not available on this surface, and neither is the `complexity` setting: `output_format` accepts png, webp and jpeg only, and a body naming `complexity`, `frame_count` or `frame_duration_ms` is refused before it reaches OpenAI. For vector (SVG) output, use one of Router's Recraft vector models, such as `recraft/recraftv4_1_vector`. Animated GIF output is available for gpt-image-2.6-flare and gpt-image-2.6-sunburst only -- see OpenAIImageRouterRequestGif.","example":{"prompt":"a rocketship on a launchpad","quality":"low","size":"1024x1024"},"not":{"anyOf":[{"required":["complexity"]},{"required":["frame_count"]},{"required":["frame_duration_ms"]}]},"properties":{"background":{"description":"Background transparency. `auto` lets the model choose.","enum":["transparent","opaque","auto"],"example":"opaque","type":"string"},"image":{"$ref":"#/components/schemas/OpenAIImageRouterSource"},"mask":{"allOf":[{"$ref":"#/components/schemas/OpenAIImageRouterMedia"}],"description":"Optional. Marks the region to edit: its fully transparent areas are what the model replaces. Must be a PNG with an alpha channel, under 4 MiB -- the bound routerOpenAIMaskMaxBytes ENFORCES on the resolved bytes, so an oversize mask is refused here by its size rather than relayed from the provider -- and matching the dimensions of the first `image`. Same accepted forms as `image`. Ignored -- and meaningless -- when `image` is absent, because there is nothing to mask: Router strips it from the request rather than forwarding it to the text-to-image operation, which would reject it as an unknown parameter."},"model":{"description":"The gpt-image model to run. Router splices the addressed model id in, so a caller addressing /v2/models/openai/gpt-image-2 does not send this.","example":"gpt-image-2.5-flare","type":"string"},"moderation":{"description":"Content moderation setting","enum":["low","auto"],"example":"auto","type":"string"},"n":{"description":"The number of images to generate (1-10).","example":1,"maximum":10,"minimum":1,"type":"integer"},"output_compression":{"description":"Compression level for JPEG or WebP (0-100)","example":100,"maximum":100,"minimum":0,"type":"integer"},"output_format":{"description":"Format of the output image","enum":["png","webp","jpeg"],"example":"png","type":"string"},"partial_images":{"description":"Meaningful only alongside a live stream, which this surface cannot serve -- `stream` is settled to `false` even when you send it. On a generation, any value other than `0` or `null` is refused with a 400, whether or not the request also sends `stream: true`; on a request carrying `image` the field is dropped rather than forwarded. Omit it.","example":0,"maximum":3,"minimum":0,"nullable":true,"type":"integer"},"prompt":{"description":"A text description of the image to generate, or of the edit to make to `image`.","example":"Give the rocketship rainbow coloring","type":"string"},"quality":{"description":"The quality of the generated or edited image. `xhigh` and `max` are the two tiers gpt-image-2.5-flare and gpt-image-2.5-sunburst were added for; `standard` and `hd` are dall-e-era spellings no admitted model reads.","enum":["auto","low","medium","high","xhigh","max","standard","hd"],"example":"high","type":"string"},"size":{"description":"Size of the image (e.g., 1024x1024, 1536x1024, auto)","example":"1024x1536","type":"string"},"stream":{"description":"Declared so a caller who sends it is not refused, but INERT on this surface: Router SETTLES it to `false` before dispatch, because it captures the provider response rather than relaying a `text/event-stream` (a request carrying `image` drops the field instead, since the edit is re-encoded without it). No Comfy surface serves gpt-image partial-image streaming: the v1 `POST /proxy/openai/images/generations` ingress refuses `stream: true` with a 400 and never forwards the request upstream, so omit the field and read the completed response as one JSON body. Because the stream never opens, OpenAI's restriction on combining `stream: true` with `n` greater than 1 does not apply here; `n` is forwarded as sent.","example":false,"nullable":true,"type":"boolean"},"user":{"description":"A unique identifier for end-user monitoring","example":"user-1234","type":"string"}},"required":["prompt"],"type":"object"}}}},"responses":{"200":{"description":"OK - the model's native JSON output, returned unchanged; the schema describes the provider's terminal result document as Router returns it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenAIImageGenerationResponse"},{"properties":{"background":{"description":"Whether the generated image's background is `opaque` or `transparent`, as OpenAI resolved it for this generation. The request parameter defaults to `auto`, so this is where a caller who did not pin it learns which one was produced.","type":"string"},"created":{"description":"Unix timestamp, in seconds, of when the generation completed. It is the one member OpenAI declares REQUIRED on an image-generation response, so it is present whenever OpenAI is the producer; a fal-, minimax-, wavespeed- or runware-served response on any of the alt-backed ids omits it entirely, like the other four resolved-parameter members. Declared `int64` because a present-day epoch value is close enough to 2^31 that an unformatted `integer` generates a 32-bit field in many SDK generators.","format":"int64","type":"integer"},"output_format":{"description":"The encoding of the bytes in `data[].b64_json` — `png`, `webp` or `jpeg`. It is the format OpenAI actually encoded, which is the request's `output_format` when one was sent and `png` when none was, so a decoder can key off it rather than re-deriving the format from the request.","type":"string"},"quality":{"description":"The quality tier the generation actually ran at — OpenAI reports one of `low`, `medium`, `high`, `xhigh` or `max`. It is the RESOLVED tier, not an echo of the request, whose own `quality` defaults to `auto`.","type":"string"},"size":{"description":"The pixel dimensions the generation actually ran at, as `\u003cwidth\u003ex\u003cheight\u003e`. It is the RESOLVED size: the request's `size` defaults to `auto` and explicitly admits `auto`, so this is the only place the dimensions actually used are reported.","type":"string"}},"type":"object"}],"description":"Comfy Router output schema for the OpenAI gpt-image models: OpenAI's own image-generation response, forwarded unchanged. The operation is direct-return (`routerresult/classification.go` classifies `openai /images/generations` as ReturnModeDirect with no poll route), so the body a caller receives is this finished document from the one call. That row also raises the read limit to `BinaryResultMaxBytes`, because the images can arrive INLINE and `n` admits up to 10 of them at a `size` and `quality` the operation does not bound.\nOn the id with a single producer — `openai/gpt-image-1.5` — and on every other id whenever OpenAI itself serves it, the generated images are in `data`, always INLINE at `data[].b64_json`: OpenAI has no `url` response format at all on this surface, so `url` stays unpopulated there even though the shared response component declares it. That also means the bytes are durable in the only sense that matters here — they are in the body, not behind a link that expires. `revised_prompt` is the prompt OpenAI rewrote rather than an asset, and it is present on a response whose image never arrived, so it must not be read as one. `usage` is OpenAI's own token accounting — OpenAI's numbers, not the Comfy charge.\n`openai/gpt-image-2` (`fal`, `minimax`, `runware`, `wavespeed`), `openai/gpt-image-2.5-flare` (`fal`, `minimax`, `runware`, `wavespeed`), `openai/gpt-image-2.5-sunburst` (`fal`, `minimax`, `runware`, `wavespeed`), `openai/gpt-image-2.6-flare` (`minimax`) and `openai/gpt-image-2.6-sunburst` (`minimax`) have ALTERNATE producers: an eligible request on any of them may instead be served by a registered partner (fal, wavespeed or runware on the 2 and 2.5 ids, minimax on the 2, 2.5 and 2.6 ids). The Pika copy of gpt-image-2 is withdrawn. Each partner is reachable explicitly, via `model_provider=fal`, `model_provider=wavespeed`, `model_provider=runware` or `model_provider=minimax`; the minimax leg serves an edit only from inline `data:` images. One may also serve a request that named nobody: `fallback_provider` (default ON) retries a GENERATION once against a registered alternate when the OpenAI attempt fails for a reason attributable to Router or to OpenAI, never to the caller's request. Do not read that retry as fal's alone — it walks the id's registered partners in order and takes the first whose provider gate, workspace partner-provider policy, eligibility valve and translation all succeed. By default that order is alphabetical by partner (fal, then minimax, then runware, then wavespeed), so the first of them the caller's gates admit answers it whenever fal is ruled out; Comfy can change the order per model at runtime without notice, so do not rely on a particular partner answering a retry. And it does not apply to an EDIT: a body carrying `image` selects the multipart edits operation, for which the automatic retry is disabled outright, so an edit that OpenAI fails comes back as OpenAI's own failure rather than being retried against a partner. (Naming a partner explicitly still serves an edit, wherever that partner's translator carries the media field itself.) Every one of those routes is the alt-provider dispatch in `server/implementation/router_run.go`, whose `routerAltTranslators` supplies the translator half against the matching `routeralt` leg that carries the alt id (`fal-gpt-image-2`, `wavespeed-gpt-image-2.5-flare`, `runware-gpt-image-2.5-sunburst` and so on — one leg per id-and-partner pair); the two halves are joined at init and a half-registration fails the build. Apart from minimax, none of the partners returns inline base64 on any of the alt-backed ids — each only returns hosted URLs, so a response they serve carries `data[].url` and never `data[].b64_json`, the opposite of the OpenAI-served shape above. A minimax-served response on `openai/gpt-image-2`, the 2.5 ids or the 2.6 ids relays MiniMax's inline `data[].b64_json`, the same shape as OpenAI's. A caller that requested `response_format: b64_json` on an alt-provider-served attempt is told so through `X-Comfy-Router-Dropped-Params` rather than being given inline bytes. Both of those statements describe the answer TRANSLATED BACK into this contract, which is what the default `strict_mode=false` returns. `strict_mode=true` runs no translation in either direction: the partner's own raw envelope comes back unchanged and carries no `X-Comfy-Router-Dropped-Params`, and Router returns that same raw envelope on the rarer path where a response cannot be translated back. Such a body is the PARTNER's contract, not this schema, and must not be parsed as this one — the call is billed either way. Their translators do not fabricate the OpenAI-specific fields they cannot produce: on an alt-provider-served response `usage`, `revised_prompt`, and all four resolved-parameter members below are entirely ABSENT, not merely empty. Branch on the keys a response actually carries rather than on an assumed producer; which partner served a given request on any of the alt-backed ids is a Comfy routing decision that can change without notice, and is not part of this contract.\nFor the single-producer id, and for every other id whenever OpenAI is the one that served it, the four resolved-parameter members (`background`, `output_format`, `quality`, `size`) report what OpenAI ACTUALLY RAN rather than echoing the request: `background`, `quality` and `size` each default to `auto` on the request side, so a caller who sends `auto` — or sends nothing — only learns the concrete background, tier and `\u003cwidth\u003ex\u003cheight\u003e` that were used by reading them here. `created` is the one member OpenAI declares required whenever OpenAI is the producer.","example":{"created":1767225600,"data":[{"b64_json":"PGJhc2U2ND4="}],"usage":{"input_tokens":12,"input_tokens_details":{"image_tokens":0,"text_tokens":12},"output_tokens":1056,"total_tokens":1068}}}}}}}}}},"components":{"schemas":{"OpenAIImageGenerationResponse":{"properties":{"data":{"items":{"properties":{"b64_json":{"description":"Base64 encoded image data","type":"string"},"revised_prompt":{"description":"Revised prompt","type":"string"},"url":{"description":"URL of the image","type":"string"}},"type":"object"},"type":"array"},"usage":{"properties":{"input_tokens":{"type":"integer"},"input_tokens_details":{"properties":{"image_tokens":{"type":"integer"},"text_tokens":{"type":"integer"}},"type":"object"},"output_tokens":{"type":"integer"},"output_tokens_details":{"properties":{"image_tokens":{"type":"integer"},"text_tokens":{"type":"integer"}},"type":"object"},"total_tokens":{"type":"integer"}},"type":"object"}},"type":"object"},"OpenAIImageRouterMedia":{"description":"One image, as either an https URL Router fetches on the caller's behalf or a `data:image/\u003cformat\u003e;base64,\u003cpayload\u003e` URI carrying the bytes inline. Accepted image types are png, webp and jpeg, and that set is ENFORCED at resolve time rather than left to the provider -- an svg, gif, avif or tiff is refused here, naming the image you sent, instead of becoming a partner error two hops from the cause.\nPrefer the URL form. A base64 payload inflates roughly 4/3 and the whole request body is capped at 100 MiB, so the inline form caps out near a 75 MB source image; a URL sidesteps that entirely. The per-image and per-request media ceilings stated at the end of this description are tighter than the body cap, so for an image of any real size they are what you meet first.\nTHE URL MUST RESOLVE WITHOUT YOUR CREDENTIALS. Router fetches it server-side and sends no caller credential with the request, so a presigned URL -- one whose signature is in the query string -- is the supported form. An authenticated endpoint such as `/api/assets/{id}/content` answers Router 401 rather than the image; request that URL yourself and pass the signed URL it redirects to.\nTHE FETCH IS CONFINED TO A NAMED SET OF HOSTS rather than the open internet, and the same list is re-applied to every redirect hop as well as to the URL you send -- so a URL on any other host, or one that redirects off the list, is refused before any provider is contacted. Today that list is Comfy's own asset delivery only: a signed `storage.googleapis.com` URL under a Comfy asset bucket, which is the form `/api/assets/{id}/content` redirects you to. A partner CDN or a plain https host is NOT on the list.\nTWO WIDENINGS ARE BEING ROLLED OUT AND ARE BOTH OFF BY DEFAULT TODAY. They ship behind ONE switch and are enabled together, so treat everything below as forthcoming rather than as something to build against yet -- ask before you rely on either.\nThe FIRST is the bucket `POST /customers/storage` signs your upload into. Until the rollout reaches your environment an upload URL from that endpoint is refused here, even though the bucket is Comfy's own and the host is the same one -- so \"upload to Comfy, then pass the URL\" does NOT work yet, and the form that does is the signed URL `/api/assets/{id}/content` redirects to.\nThe SECOND is ENABLED PER ACCOUNT rather than for everyone at once, because the bucket behind these hosts is yours rather than ours: even once the switch above is on, an account that has not had third-party inbound media enabled is refused, and told so in those words rather than told the host is unsupported. Ask your Comfy contact to enable it for your account. It additionally admits these third-party object-storage hosts, where the bucket is yours and Router makes no ownership claim on it: Cloudflare R2 (`\u003caccount\u003e.r2.cloudflarestorage.com`, `pub-\u003chash\u003e.r2.dev`), Amazon S3 (`s3.amazonaws.com` and `s3.\u003cregion\u003e.amazonaws.com`, in either the path-style or the `\u003cbucket\u003e.`-prefixed form), Azure Blob Storage (`\u003caccount\u003e.blob.core.windows.net`) and Alibaba Cloud OSS (`\u003cbucket\u003e.oss-\u003cregion\u003e.aliyuncs.com`, including the `oss-accelerate` endpoint). Those are object-storage endpoints specifically: a general-purpose endpoint on the same provider domain, such as an Alibaba Function Compute trigger, is not on the list and is refused.\nWHAT IS MATCHED IS THE HOSTNAME FORM, NOT THE PROVIDER -- so naming a provider above does NOT mean every URL that provider can issue is accepted, and three near-misses are worth stating outright because a caller can reasonably arrive with each of them. An R2 CUSTOM DOMAIN (`cdn.example.com`) is NOT accepted: Cloudflare documents `pub-\u003chash\u003e.r2.dev` as a rate-limited debug hostname and points production traffic at a custom domain instead, but a custom domain carries nothing in its hostname identifying it as R2, so Router cannot tell it from any other host and refuses it -- presign the `\u003caccount\u003e.r2.cloudflarestorage.com` endpoint, or use the `pub-\u003chash\u003e.r2.dev` form. S3's IPv6 dualstack endpoint (`s3.dualstack.\u003cregion\u003e.amazonaws.com`) is not accepted either; use the plain regional endpoint. Nor is Azure Blob's alternate DNS zone (`\u003caccount\u003e.z\u003cN\u003e.blob.storage.azure.net`); use `\u003caccount\u003e.blob.core.windows.net`. The refusal you get back names these same forms, so you do not have to come here to read them.\nThe `\u003caccount\u003e` and `pub-\u003chash\u003e` placeholders above show the form you will normally arrive with; they are not a depth restriction. Matching is on the object-storage domain suffix, so a deeper name under the same namespace (`a.b.pub-\u003chash\u003e.r2.dev`) is accepted as well. What is NOT widened by that is the namespace itself -- the suffix still has to be one of the ones listed.\nThe example below shows the shape only: a real value also carries the signing query parameters, which are deliberately omitted here because a published example lives in the spec forever and a real signature is both a leaked credential and a link that stops working.\nEach image is capped at 25 MiB and one request's images at 64 MiB in total. The one exception is ideogram/ideogram-4-5 Precise Edit (a call that sends `image`) where `context_window` is available: there each image may be up to 50 MB (50,000,000 bytes) and 67,108,864 pixels, and one request's images up to 128 MiB in total.","example":"https://storage.googleapis.com/comfy-cloud-assets/0199b3f4-1d2e-7a3b-8c4d-5e6f70819234.png","type":"string"},"OpenAIImageRouterSource":{"description":"The source image(s) to edit. PRESENCE OF THIS FIELD SELECTS THE EDIT OPERATION -- omit it entirely for text-to-image generation.\nThe model's published example is the GENERATION call, which omits this field. Adding `image` is the whole of the difference between the two modes -- same endpoint, same model id -- except that an edit prompt describes the CHANGE you want rather than the scene, so the edit body below reads differently from the generation example even though only this field is structurally new.\nIt is copyable exactly as printed: `{\"prompt\": \"give the rocketship rainbow coloring\", \"image\": [\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==\"], \"size\": \"1024x1024\"}` -- the payload is a complete 1x1 PNG, not an abbreviation, and this body is pinned as an accepted case in Router's own request-validation tests. Swap in your own image's bytes.\nAccepts one image or an array of them; gpt-image-1 and later take up to 16, which Router enforces from this schema before dispatching.","oneOf":[{"$ref":"#/components/schemas/OpenAIImageRouterMedia"},{"items":{"$ref":"#/components/schemas/OpenAIImageRouterMedia"},"maxItems":16,"minItems":1,"type":"array"}]}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"openai/gpt-image-1.5","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text","image"],"x-comfy-router-output-modalities":["image"]}
