Skip to main content
POST
Generate Images

Overview

Use POST /api/v1/images to generate images through NanoGPT’s normalized Image API. The endpoint accepts JSON only and supports text-to-image and image-to-image requests for models that expose those capabilities. Discover model-specific parameters first with:
  • GET /api/v1/images/models
  • GET /api/v1/images/models/{modelId}/endpoints

Authentication

Use either header:
  • Authorization: Bearer YOUR_API_KEY
  • x-api-key: YOUR_API_KEY

Request

Text-To-Image Example

Image-To-Image Example

Request Fields

NanoGPT exposes many model-specific parameters. Treat parameter support as discoverable through supported_parameters, not globally available.

Input References

input_references accepts an array of image references. Supported entries:
Do not mix 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.

Unsupported Features

stream: true is not supported yet. Provider selection and provider passthrough are not supported yet. Non-empty provider objects return unsupported_provider_options.

Common Errors

Notes

  • Use n for output count. If your request also sends nImages, nImages takes precedence.
  • Use Image API for the full guide and error response examples.