Image Generation
Generate images from text prompts using multiple AI providers with a unified API.
Supported Models
Usage
SDK
const response = await cencori.ai.generateImage({
prompt: "A futuristic city at sunset with flying cars",
model: "dall-e-3",
size: "1024x1024",
quality: "hd"
});
console.log(response.images[0].url);API Request
POST https://cencori.com/api/ai/images/generate
Headers: { "CENCORI_API_KEY": "csk_..." }
Body: {
"prompt": "A futuristic city at sunset",
"model": "dall-e-3",
"size": "1024x1024"
}Parameters
Response
{
"images": [
{
"url": "https://...",
"revisedPrompt": "A futuristic cityscape..."
}
],
"model": "dall-e-3",
"provider": "openai"
}Auto-router (auto / cencori-auto)
Pass model: 'auto' to resolve a quality-ordered BYOK image model for the project (gpt-image-1 → dall-e-3 → dall-e-2 → Google), verified against image pricing for the requested size/quality. n > 1 only matches dall-e-2; Google-incompatible options match OpenAI only. BYOK-only: no usable key returns 402 byok_required, and it never falls back to managed keys. Details: BYOK auto-router.