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
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.
Parameters
The parameters for image generation.
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Text description of the image to generateRequired |
| route | string | Predefined route with provider fallback chain. See available routes |
| model | string | Model alias (e.g., flux-2-dev) with automatic provider failover. See available aliases |
| aspect_ratio | string | Image aspect ratio. See supported ratios |
| seed | integer | Reproducible generation—same seed produces same image |
| cache | string | Set to 'false' to bypass cache and force new generation |
Routes
Routes provide automatic fallback between providers. If one provider fails, the next in the chain is tried.
quality/fastFast & CheapPrioritizes speed and cost. Best for prototyping and high-volume use.
quality/balancedBalancedBalanced quality, cost, and speed for production use.
quality/highHigh QualityPremium quality for hero images and marketing assets.
text/fastFast TextQuick text generation for prototyping.
text/balancedBalanced TextGood text accuracy with reasonable speed.
text/highHigh TextBest readable text in images.
realistic/fastFast PhotorealismQuick photorealistic generation.
realistic/balancedBalanced PhotorealismGood photorealism with reasonable speed.
realistic/highMaximum PhotorealismMaximum photorealism for portraits and realistic scenes.
Example
<img src="https://demo.imagegpt.host/image?prompt=A%20sunset&route=quality/high" alt="Sunset" />Model Aliases
Request a specific model by its canonical name. The system automatically tries multiple providers for reliability and performance.
Gemini
gemini-3-pro-imagePremiumGoogle Gemini 3 Pro Image — flagship image generation and editing.
gemini-3.1-flash-imageHigh QualityGoogle Gemini 3.1 Flash Image — fast, high-quality generation and editing with pro-level quality.
gemini-3.1-flash-lite-imageFast ValueGoogle Gemini 3.1 Flash Lite Image — fastest, most cost-effective Gemini model with editing and legible text.
gemini-2.5-flash-imageBalancedGoogle Gemini 2.5 Flash Image — fast multimodal image generation.
Flux 2
flux-2-devBalancedFlux 2 Dev — high quality image generation.
flux-2-proPremiumFlux 2 Pro — premium quality image generation.
flux-2-dev-turboFastFlux 2 Dev Turbo — fast variant of Flux 2.
flux-2-fastFastFlux 2 Fast — speed-optimized Flux 2.
flux-2-klein-4bUltra-FastFlux 2 Klein 4B — ultra-fast 4 billion parameter model.
flux-2-klein-4b-distilledUltra-FastFlux 2 Klein 4B Distilled — fastest Klein variant.
flux-2-klein-9bFastFlux 2 Klein 9B — higher quality 9 billion parameter model.
Flux 1
flux-1-schnellUltra-FastFlux 1 Schnell — fastest Flux model.
flux-1.1-pro-ultraPremiumFlux 1.1 Pro Ultra — premium 4MP raw mode.
Other Models
recraft-v3High QualityRecraft V3 — versatile style-based generation.
ideogram-v3Best TextIdeogram V3 — industry-leading text rendering.
qwen-image-2512High QualityQwen Image 2512 — excellent realism and multilingual text.
seedream-4.5High QualitySeedream 4.5 — high quality with strong typography.
glm-imageHigh QualityGLM Image — excellent text rendering and realism.
grok-imagineBalancedGrok Imagine — highly aesthetic photorealistic images.
juggernaut-flux-proPremiumJuggernaut Flux Pro — maximum photorealism.
imagineart-1.5BalancedImagineArt 1.5 — lifelike realism and text rendering.
imagineart-1.5-proPremiumImagineArt 1.5 Pro — 4K professional-grade visuals.
Example
<img src="https://demo.imagegpt.host/image?prompt=A%20sunset&model=flux-2-dev" alt="Sunset" />Automatic failover: Model aliases try multiple providers in order. If one provider fails, the next is tried automatically — same reliability as routes.
Aspect Ratios
Control the shape and size of generated images.
1:1Square (1024x1024)
16:9Landscape (1344x768)
9:16Portrait (768x1344)
4:3Standard (1152x896)
3:4Tall (896x1152)
3:2Photo (1216x832)
Response Format
All requests return an image with HTTP response headers conveying information about that request.
Response Headers
| Header | Description |
|---|---|
| Content-Type | image/webp, image/jpeg, or image/png |
| X-Generation-Time-Ms | Generation duration in milliseconds |
| X-Request-Id | Unique request identifier for debugging |
| IGPT-Credits | Credits 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.
Errors
When an error occurs, the response still returns an image (a placeholder) with error details in headers.
Invalid Parameters
An unrecognized parameter value never fails the request. The value is replaced with a documented default and the image is generated normally, so a typo in a URL already published on a page does not turn into a broken image for every visitor.
| Parameter | Fallback |
|---|---|
| aspect_ratio | Nearest ratio the model supports, otherwise the model default (4:4 becomes 1:1) |
| model / route | The default route, quality/fast |
| format | The model’s default output format |
| Numeric parameters | Clamped to the supported range, or dropped when the value is not a number |
| image_url | Dropped when malformed or unsupported by the model; the prompt alone is generated |
Every substitution is reported in an IGPT-Warning response header — one per parameter — so it can be logged or alerted on:
IGPT-Warning: code=PARAM_COERCED; param=aspect_ratio; requested="4:4"; used="1:1" IGPT-Warning: code=PARAM_DROPPED; param=seed; requested="latest"
The header is present on every response that had a substitution, including cache hits and responses blocked by a security policy — so a blocked request still tells you its parameters were wrong. Only a request that cannot be served at all, such as one with no prompt, returns an error.
Error Headers
| Header | Description |
|---|---|
| IGPT-Error | code=<CODE>; message="..." — the error code and a human-readable description |
| X-Image-Type | placeholder when the image returned is an error placeholder |
| X-Request-Id | Request identifier for debugging |
Error Codes
| Code | Meaning |
|---|---|
| VALIDATION_ERROR | Invalid or missing parameters |
| PROJECT_NOT_FOUND | Invalid project slug in subdomain |
| POLICY_BLOCKED | Blocked by a project security policy |
| LIMIT | Rate limit exceeded |
| TRIAL_CREDITS_EXHAUSTED | Trial credits used up |
| CREDIT_LIMIT_REACHED | Monthly credit limit reached |
| GENERATION_FAILED | All 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:
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"
/>