Chat with
ImageGPT Reference

URL-Based Image
Generation

Generate images by constructing a URL. No SDKs, no API keys in headers—just build a URL and use it as an image source.

Psst, Agents should look here → llms.txt

Getting Started

Quick Start

The simplest way to generate an image.

Base URL Format

https://{project}.imagegpt.host/image?prompt={your prompt}

Example

<img src="https://demo.imagegpt.host/image?prompt=A%20sunset%20over%20mountains" alt="Sunset" />

Project slug: Your project slug is the subdomain. Create a project in the dashboard to get your unique slug.

Reference

Parameters

The parameters for image generation.

ParameterTypeDescription
promptstringText description of the image to generateRequired
routestringPredefined route with provider fallback chain. See available routes
modelstringModel alias (e.g., flux-2-dev) or explicit provider@model format. Aliases provide automatic failover across providers.
aspect_ratiostringImage aspect ratio. See supported ratios
seedintegerReproducible generation—same seed produces same image
cachestringSet to 'false' to bypass cache and force new generation
Routing

Routes

Routes provide automatic fallback between providers. If one provider fails, the next in the chain is tried.

quality/fastFast & Cheap

Prioritizes speed and cost. Best for prototyping and high-volume use.

~5-21 credits/MP

quality/balancedBalanced

Balanced quality, cost, and speed for production use.

~12-30 credits/MP

quality/highHigh Quality

Premium quality for hero images and marketing assets.

~45–68 credits/MP

text/fastFast Text

Quick text generation for prototyping.

~15 credits/MP

text/balancedBalanced Text

Good text accuracy with reasonable speed.

~15–60 credits/MP

text/highHigh Text

Best readable text in images.

~45–68 credits/MP

realistic/fastFast Photorealism

Quick photorealistic generation.

~5–12 credits/MP

realistic/balancedBalanced Photorealism

Good photorealism with reasonable speed.

~12–30 credits/MP

realistic/highMaximum Photorealism

Maximum photorealism for portraits and realistic scenes.

~45–83 credits/MP

Example

<img src="https://demo.imagegpt.host/image?prompt=A%20sunset&route=quality/high" alt="Sunset" />
Dimensions

Aspect Ratios

Control the shape and size of generated images.

1:1

Square (1024x1024)

16:9

Landscape (1344x768)

9:16

Portrait (768x1344)

4:3

Standard (1152x896)

3:4

Tall (896x1152)

3:2

Photo (1216x832)

Response

Response Format

All requests return an image with HTTP response headers conveying information about that request.

Response Headers

HeaderDescription
Content-Typeimage/webp, image/jpeg, or image/png
X-Generation-Time-MsGeneration duration in milliseconds
X-Request-IdUnique request identifier for debugging
IGPT-CreditsCredits consumed by this request

Always an image: Every response returns valid image data, making the URL safe to use directly in <img> tags and image contexts without error handling.

Troubleshooting

Errors

When an error occurs, the response still returns an image (a placeholder) with error details in headers.

Error Headers

HeaderDescription
X-Error-CodeError code identifying the issue
X-Error-MessageHuman-readable error description
X-Request-IdRequest identifier for debugging

Error Codes

CodeMeaning
VALIDATION_ERRORInvalid or missing parameters
PROJECT_NOT_FOUNDInvalid project slug in subdomain
UNKNOWN_ROUTESpecified route does not exist
LIMITRate limit exceeded
TRIAL_CREDITS_EXHAUSTEDTrial credits used up
CREDIT_LIMIT_REACHEDMonthly credit limit reached
GENERATION_FAILEDAll providers failed to generate

Error Image

When an error occurs, an error image is returned instead of a broken image. The image includes the error category and a brief description:

Example error placeholder
Examples

Full Examples

Basic HTML

<img src="https://demo.imagegpt.host/image?prompt=A%20sunset%20over%20mountains" alt="Sunset over mountains" />

High quality with aspect ratio

<img src="https://demo.imagegpt.host/image?prompt=Professional%20headshot&route=quality/high&aspect_ratio=3:4" alt="Professional headshot" />

Text rendering (sign, label, etc.)

<img src="https://demo.imagegpt.host/image?prompt=A%20neon%20sign%20that%20says%20OPEN&route=text/high" alt="Neon open sign" />