Integrate AI image generation directly into your product with our clean REST API. Fast, reliable, and built for scale.
The GenPicz API is a RESTful HTTP API that allows you to generate images programmatically from text prompts. All requests are authenticated using API keys and return JSON responses.
Base URL
https://api.genpicz.com/v1
All API requests must be made over HTTPS. Requests made over plain HTTP will be rejected. The API uses conventional HTTP response codes to indicate success or failure.
GenPicz uses API keys for authentication. You can create and manage your API keys from the Settings → API Keys section of your dashboard.
Pass your API key as a Bearer token in the Authorization header of every request:
Authorization: Bearer gp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Generate your first image in under 60 seconds. Replace YOUR_API_KEY with your key from the dashboard.
curl https://api.genpicz.com/v1/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "a neon samurai in a cyberpunk city, cinematic lighting", "style": "cinematic", "width": 1024, "height": 1024 }'
const response = await fetch('https://api.genpicz.com/v1/generate', { method: 'POST', headers: { 'Authorization': `Bearer ${process.env.GENPICZ_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt: 'a neon samurai in a cyberpunk city', style: 'cinematic', width: 1024, height: 1024, }), }); const { image_url, generation_id } = await response.json(); console.log(image_url); // https://cdn.genpicz.com/gen/abc123.png
import requests response = requests.post( "https://api.genpicz.com/v1/generate", headers={ "Authorization": f"Bearer {GENPICZ_API_KEY}", "Content-Type": "application/json", }, json={ "prompt": "a neon samurai in a cyberpunk city", "style": "cinematic", "width": 1024, "height": 1024, }, ) data = response.json() print(data["image_url"]) # https://cdn.genpicz.com/gen/abc123.png
/v1/generate
Generate a new image from a text prompt. Returns a URL to the generated image and a generation ID.
/v1/generations/{id}
Retrieve the status and result of a specific generation by its ID. Useful for async workflows.
/v1/generations
List all past generations for the authenticated account, with pagination support.
/v1/generations/{id}
Delete a specific generation and remove the associated image from CDN storage.
/v1/styles
List all available style presets with IDs, names, and example output thumbnails.
/v1/account
Returns account information including remaining credits, plan type, and usage statistics.
| Parameter | Type | Description |
|---|---|---|
| prompt | string | Required. Text description of the image to generate. Max 1,500 characters. |
| style | string | Style preset ID. See /v1/styles for available values. Defaults to "auto". |
| width | integer | Output width in pixels. Accepted: 512, 768, 1024, 1280, 1920. Default: 1024. |
| height | integer | Output height in pixels. Same accepted values as width. Default: 1024. |
| quality | string | Generation quality. One of "standard", "hd", "ultra". Default: "hd". |
| negative_prompt | string | Elements to avoid in the output. Max 500 characters. |
| seed | integer | Random seed for reproducible results. Omit for a random seed. |
| upscale | boolean | Upscale output to 4× resolution. Studio plan only. Default: false. |
| webhook_url | string | HTTPS URL to receive a POST callback when generation completes. See Webhooks section. |
All successful responses return HTTP 200 with a JSON body. Errors return the appropriate HTTP code with an error object.
{
"generation_id": "gen_Kz9mN4pQr2xTvW",
"status": "completed",
"image_url": "https://cdn.genpicz.com/gen/Kz9mN4pQr2xTvW.png",
"width": 1024,
"height": 1024,
"style": "cinematic",
"seed": 4829301,
"created_at": "2025-06-01T10:32:44Z",
"credits_used": 1
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "You have exceeded 60 requests per minute.",
"status": 429
}
}
Requests are rate-limited per API key, per minute. If you exceed the limit, the API returns HTTP 429. Limits reset at the start of each minute (UTC).
Starter
10
requests / minute
Pro
30
requests / minute
Studio
60
requests / minute
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.
Enterprise customers with higher volume requirements can contact us to discuss dedicated rate limit tiers.
For asynchronous workflows, pass a webhook_url in your generate request. When generation completes, GenPicz will POST the result payload to that URL.
{
"event": "generation.completed",
"generation_id": "gen_Kz9mN4pQr2xTvW",
"status": "completed",
"image_url": "https://cdn.genpicz.com/gen/Kz9mN4pQr2xTvW.png",
"created_at": "2025-06-01T10:32:44Z"
}
Validate webhook authenticity by checking the X-GenPicz-Signature header, which is an HMAC-SHA256 of the raw request body using your webhook secret.
Official SDK packages are currently in development and will be published shortly. In the meantime, the API is straightforward to use with any standard HTTP library.
@genpicz/sdk — coming soon
JavaScript / TypeScript SDK for Node.js and browser environments.
genpicz — coming soon
Python SDK with async support via asyncio.
Questions about the API? Contact our developer support team.