Dashboard|

Image Generation

Generate images from text prompts using multiple AI providers with a unified API.

Supported Models

ProviderModelDescription
OpenAIgpt-image-2State-of-the-art image generation
OpenAIgpt-image-1.5Best text rendering, top ELO rating
OpenAIgpt-image-1ChatGPT image generation
OpenAIgpt-image-1-miniFast, cost-effective
Googlegemini-3-pro-imageHigh photorealism, fast
Googleimagen-3Google Imagen 3, high quality

OpenAI removed dall-e-3 and dall-e-2 from its API on 12 May 2026. A request for either returns 400 model_retired.

Usage

SDK

const response = await cencori.ai.generateImage({
  prompt: "A futuristic city at sunset with flying cars",
  model: "gpt-image-1",
  size: "1024x1024",
  quality: "high"
});
 
console.log(response.images[0].b64_json);

API Request

POST https://api.cencori.com/v1/images/generations
Headers: { "CENCORI_API_KEY": "csk_..." }
Body: {
  "prompt": "A futuristic city at sunset",
  "model": "gpt-image-1",
  "size": "1024x1024"
}

Parameters

ParameterTypeRequiredDescription
promptstringYesText description of the image
modelstringNoImage model (default: gpt-image-1)
sizestringNo1024x1024, 1536x1024, 1024x1536. Google models: 1024x1024 only
nnumberNo1. One image per request
qualitystringNolow, medium (default) or high. standard and hd are read as medium and high

OpenAI's image models always return the image as base64 in b64_json; there is no hosted URL.

Response

{
  "images": [
    {
      "b64_json": "iVBORw0KGgo..."
    }
  ],
  "model": "gpt-image-1",
  "provider": "openai"
}

Auto-router (auto / cencori-auto)

Pass model: 'auto' to resolve a quality-ordered BYOK image model for the project (gpt-image-1 → gpt-image-1-mini → Google), verified against image pricing for the requested size/quality. 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.