Overview
NanoGPT provides a dedicated Image API for discovering image models, inspecting supported parameters and pricing, and generating images through a normalized endpoint. Use this API when you want one image workflow:- 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.
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_formatseedinput_references
supported_parameters, not as globally supported fields.
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.