Images
POST /v1/images/generations is the OpenAI-compatible image generation endpoint for clients that already speak the OpenAI Images API.
Use it when
- Your app already uses the OpenAI Images API shape.
- You want to generate one or more images from a prompt with the same Prismatic API key as text endpoints.
- The selected model and provider route both support images.
Code examples
curl https://api.prismaticapi.com/v1/images/generations -H "Authorization: Bearer $PRISMATIC_API_KEY" -H "Content-Type: application/json" -d '{
"model": "imagen-4",
"prompt": "A clean product mockup on a neutral desk",
"image_url": ["https://example.com/reference.png"],
"negative_prompt": "clutter, text artifacts",
"aspect_ratio": "16:9",
"quality": "high",
"style": "natural",
"seed": 42,
"response_format": "b64_json",
"n": 1
}'import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.PRISMATIC_API_KEY,
baseURL: "https://api.prismaticapi.com/v1"
});
const image = await client.images.generate({
model: "imagen-4",
prompt: "A clean product mockup on a neutral desk",
image_url: "https://example.com/reference.png",
negative_prompt: "clutter, text artifacts",
aspect_ratio: "16:9",
quality: "high",
style: "natural",
seed: 42,
response_format: "b64_json",
n: 1
});Parameters
model(string, required) — Public model ID returned byGET /v1/models.prompt(string, required) — Text prompt describing the image to generate.image_url(string or array, optional) — Reference image URL(s) forwarded natively or converted to multimodal chat content for chat-completions providers.negative_prompt,aspect_ratio,seed,quality,style,response_format,sizeandnare accepted and forwarded when supported by the selected provider route.
Billing and limits
- API-key and account rate limits are checked before generation.
- Subscription quota is reserved before generation and settled afterward.
- PAYG generation cost is
retail_generation_usd * n; requests are refused before upstream when generation pricing is missing or the wallet cannot cover the precise estimate. - If the model or provider route does not support images, the request fails before upstream calls.
Notes
GET /v1/modelscan list multiple public IDs that resolve to the same canonical model.- Mark a provider with the Images toggle in admin so it can receive image-generation traffic.
- The endpoint rewrites the model to the upstream ID before proxying.