We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.
Image generation API
Turn prompts and reference images into product shots, illustrations and marketing visuals. Choose aspect ratio, resolution and number of images per request, and pay only for the images you generate.
- Product and marketing imagery
- Illustrations for articles and apps
- Editing with reference images
- Thumbnails and social cards
Settings
Image generation API · 63 models
How to call the Image generation API API
- Create an API key in your dashboard.
- Install the official openai SDK for your language.
- Set baseURL to https://api14.com/api/v1 and model to "recraft/recraft-v4.1-utility-pro".
Which endpoint do I call?
POST /api/v1/images/generations with the model id and prompt. It is the same call the openai SDK makes with images.generate().
How is an image priced?
Per image or per image token, depending on the model. Each model page shows the exact price.
Can I edit an existing image?
Many image models accept reference images in the request. Check the input modalities on the model page for image input.
How do I get consistent results?
Describe subject, style, lighting and framing explicitly, keep the same model, and reuse a reference image when the model supports it.
What sizes are available?
Aspect ratios and resolutions depend on the model and are listed on each model page.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const result = await client.images.generate({
"model": "recraft/recraft-v4.1-utility-pro",
"prompt": "A minimalist product photo of a ceramic mug on a wooden table",
"n": 1,
"aspect_ratio": "1:1"
});
import { writeFile } from "node:fs/promises";
await writeFile("image.png", Buffer.from(result.data[0].b64_json, "base64"));