AI
Generate or edit images (workspace-scoped)
Generate or edit images via the Vercel AI Gateway. Supports text-to-image and image-to-image editing. Billed per image under ai:image. Pass x-blink-agent-id for per-agent usage.
post/api/v1/ai/image
Request
- Base URLhttps://core.blink.new
- URLhttps://core.blink.new/api/v1/ai/image
- Auth
- HTTP bearer
- or HTTP bearer
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(s) generated successfully
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.