AI
Generate or edit images using AI
π¨ Advanced AI Image Generation & Editing
Generate stunning images from text prompts or edit existing images via the Vercel AI Gateway. Supports multimodal LLMs (Gemini 2.5/3 Pro image) and image-only models (OpenAI gpt-image-1, BFL flux-pro, Recraft v3, etc.). Legacy fal-ai/* and bare gemini model IDs are transparently rewritten to Gateway canonical IDs, so existing SDK callers work unchanged.
Capabilities
- Text-to-image and image-to-image editing
- Up to 16 input images (multipart) or 50 URLs for multimodal models
- Multiple output formats
π± File Upload Support
- Direct file uploads via multipart/form-data
- URL references
- Base64 encoded images
- Automatic format conversion
πΎ Output
- Public GCS URLs (https://storage.googleapis.com/blink-core-storage/...)
- Multiple formats: PNG, JPEG, WebP
post/api/ai/{project_id}/image
Request
- Base URLhttps://core.blink.new
- URLhttps://core.blink.new/api/ai/{project_id}/image
- AuthHTTP bearer
Path parameters
project_idstring required
Example:my-project-123
Unique identifier for the project
Request body
Example request
{
"prompt": "A futuristic cityscape at sunset with flying cars and neon lights, rendered in a cyberpunk art style with vibrant colors",
"images": [
"https://example.com/input-image.jpg",
"data:image/heic;base64,/9j/4AAQ..."
],
"mask": "https://example.com/mask-image.png"
}Response
Image generation successful
Example response
{
"result": {
"data": [
{
"url": "https://cdn.blink.new/projects/my-project-123/images/generated-image-1750914281902-0.webp",
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA...",
"revised_prompt": "A futuristic cityscape at sunset with flying cars and neon lights, digital art style"
}
],
"created": 1713833628,
"background": "transparent",
"output_format": "webp",
"size": "1024x1024",
"quality": "hd",
"usage": {
"total_tokens": 100,
"input_tokens": 50,
"output_tokens": 50,
"input_tokens_details": {
"text_tokens": 10,
"image_tokens": 40
}
}
},
"metadata": {
"provider": "google-gemini"
}
}Changes
No recorded changes to this operation across all 1 revision of this API.