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) or explicit provider@model format. Aliases provide automatic failover across providers. |
| 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.
~5-21 credits/MP
quality/balancedBalancedBalanced quality, cost, and speed for production use.
~12-30 credits/MP
quality/highHigh QualityPremium quality for hero images and marketing assets.
~45–68 credits/MP
text/fastFast TextQuick text generation for prototyping.
~15 credits/MP
text/balancedBalanced TextGood text accuracy with reasonable speed.
~15–60 credits/MP
text/highHigh TextBest readable text in images.
~45–68 credits/MP
realistic/fastFast PhotorealismQuick photorealistic generation.
~5–12 credits/MP
realistic/balancedBalanced PhotorealismGood photorealism with reasonable speed.
~12–30 credits/MP
realistic/highMaximum PhotorealismMaximum 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" />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.
Error Headers
| Header | Description |
|---|---|
| X-Error-Code | Error code identifying the issue |
| X-Error-Message | Human-readable error description |
| 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 |
| UNKNOWN_ROUTE | Specified route does not exist |
| 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"
/>