Overview
NanoGPT provides a dedicated Image API for discovering image models, inspecting supported parameters and pricing, and generating images through a normalized endpoint.Zero Data Retention (ZDR) does not cover image generation or editing. These requests still run when ZDR-only routing is enabled, and providers may store your prompts, input media and outputs. See the Privacy Policy.
- Discover available image models with machine-readable capabilities.
- Inspect a model’s public endpoint metadata, supported parameters, pricing, and image-input constraints.
- Generate text-to-image and image-to-image outputs through
POST /api/v1/images.
POST /api/v1/images/generationsPOST /api/v1/images/editsPOST /api/v1/images/editGET /api/v1/image-models
Authentication
Use the same NanoGPT API key authentication as other API routes:Quickstart
Discover Image Models
List image models:idis the model ID to use inPOST /api/v1/images.endpointsis the URL for endpoint and pricing metadata for that model.supported_parametersis machine-readable and varies by model.supports_streamingis currently alwaysfalse.- Model IDs may contain slashes. Prefer using the returned
endpointsURL directly.
Inspect Endpoint Metadata And Pricing
Get public endpoint metadata for a model:endpoints path returned by GET /api/v1/images/models.
Response:
- NanoGPT currently returns one public endpoint per model.
provider_tagisnullbecause provider selection is not exposed yet.allowed_passthrough_parametersis an empty array for now.pricinguses public NanoGPT pricing, not provider at-cost rates.input_reference_constraintsis included when the model supports image inputs.
Generate Images
Generate images with:n to request the number of output images. Internally, n is normalized to NanoGPT’s existing nImages parameter. If both are supplied, nImages takes precedence.
See Generate Images for the endpoint reference.
Image References
input_references accepts an array of image references.
GPT Image 2.5 Flare (openai/gpt-image-2.5/flare/text-to-image) and Sunburst (openai/gpt-image-2.5/sunburst/text-to-image) accept up to 16 references using the same model ID as text-only generation. References automatically select edit mode; masks are not supported. The /api/v1/image-models catalog exposes this through capabilities.image_to_image and supported_parameters.max_input_images.
Supported entries:
input_references with legacy image aliases such as imageDataUrl, imageDataUrls, image_url, or images in the same request. The route returns conflicting_image_inputs if both styles are supplied.
Supported Parameter Discovery
Parameter support varies by model. Always checksupported_parameters from:
modelpromptnresolutionaspect_ratioqualityoutput_formatbackground(GPT Image 1, 1.5, 2.5, and 2.6:auto,opaque, ortransparent; transparent needspngorwebpoutput)seedinput_references
supported_parameters, not as globally supported fields.
seed is an optional model-specific hint that may improve reproducibility where supported by the model/provider route. Identical results are not guaranteed. Check the selected model’s supported_parameters before using it. Any stronger reproducibility guarantee belongs in documentation for the specific model/provider route, not this generic endpoint guide.
GPT Image 2.6
gpt-image-2.6-flare is designed for fast iteration; gpt-image-2.6-sunburst is designed for detailed compositions. Both support:
- Still-image resolution:
1k,2k, or4kwithaspect_ratio(1:1,1:2,2:1,1:3,3:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,9:21,21:9). These target approximately 1, 4, or 8.3 megapixels, rounded down to multiples of 16 and capped at 3840px on the long edge. For example, 4K is 3840×2160 at 16:9 or 2880×2880 at 1:1. size,image_size, orresolutionalso accept explicit pixel sizes such as1536x1024;widthplusheight, existing presets, andautoremain supported. Explicit dimensions take precedence over aspect ratio. An aspect ratio with no size uses 1K; with neither, the default remains 1024×1024. Tiers without an aspect ratio retain their existing defaults: 1K and 2K square, 4K at 3840×2160.quality:low,medium,high,xhigh, ormax.complexity:low,medium, orhigh(default). Complexity is independent of quality and has no separate fee.output_format:png,jpeg,webp, or animatedgif. NanoGPT does not support SVG output for these models.- One to four output images and up to 16 reference images for edits. Regional edits use a transparent PNG
markupannotation with at least one reference image; masks are not supported. - GIF generation without reference images:
frame_countfrom 2 to 64 (default 9) andframe_duration_msfrom 20 to 2000 (default 200, rounded to 10 ms increments). The total across all frames and outputs must fit within 8,294,400 pixels. Usesize: "auto"or consult the model’s endpoint metadata for size constraints.
pricing.per_image estimates square image output at high quality for each tier (the most expensive aspect ratio); it is not an all-inclusive fixed price. Request quotes also include conservative prompt and reference-image allowances, and GIF estimates include every frame. Read pricing.token_rates_per_million for current input, cached-input, and output rates. Cached-input rates apply only when cached token counts are reported.
Unsupported Features For Now
Streaming
stream: true is not supported yet.
Provider Selection
Provider selection and provider passthrough are not supported yet onPOST /api/v1/images.
Do not send provider routing or provider passthrough options:
Migration Notes
Use the dedicated Image API when building new image integrations. It provides model discovery, endpoint metadata, public pricing metadata, image-input constraints, and normalized JSON generation in one workflow. Use the legacy routes when you need their existing compatibility behavior:- Use
POST /api/v1/images/generationsorPOST /v1/images/generationsfor OpenAI-compatible image generation request shapes. - Use
POST /api/v1/images/editsorPOST /api/v1/images/editfor OpenAI-compatible image editing. - Use
GET /api/v1/image-modelsif your integration already depends on the older image model list format.
POST /api/v1/images uses input_references; older routes support aliases such as imageDataUrl and imageDataUrls.
Error Reference
Missing Model
Invalid Content Type
POST /api/v1/images accepts JSON only.