Image API
Generate and edit images with Imagen 4, Flux, Recraft, Ideogram, and more
Generate images from text prompts or edit existing images using 13 models across 3 providers — all through a single API.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /api/v1/image/generate | Text-to-image generation |
POST | /api/v1/image/edit | Edit an existing image with a prompt |
Available Models
Image Generation
| Model | ID | Provider | Price | Notes |
|---|---|---|---|---|
| Imagen 4 | imagen-4 | $0.04/image | Flagship, great text rendering | |
| Imagen 4 Fast | imagen-4-fast | $0.02/image | Quick generation | |
| Imagen 4 Ultra | imagen-4-ultra | $0.06/image | Highest quality, 2K | |
| Flux 2 Pro | flux-2-pro | BFL | ~$0.03-0.05/image | Best open image model |
| Flux 2 Klein | flux-2-klein | BFL | cheaper | Fast, budget |
| Flux 1.1 Pro | flux-1.1-pro | BFL | $0.04/image | Previous gen, still strong |
| Recraft V4 | recraft-v4 | fal.ai | $0.04/image | Design-focused, vector SVG support |
| Recraft V3 | recraft-v3 | fal.ai | $0.04/image | Previous gen |
| Ideogram V3 | ideogram-v3 | fal.ai | $0.03-0.09/image | Best text-in-image rendering |
| Stable Diffusion 3.5 | sd-3.5 | fal.ai | ~$0.03/image | Open-weights classic |
| Qwen Image | qwen-image | fal.ai | $0.075/image | Strong multilingual prompts |
Image Editing
| Model | ID | Provider | Price | Notes |
|---|---|---|---|---|
| Flux Kontext | flux-kontext | BFL | per-image | Context-aware editing |
| Qwen Image Edit | qwen-image-edit | fal.ai | $0.075/image | Text + object editing |
| Seedream 5 | seedream-5 | fal.ai | ~$0.04/image | Style transfer, smart editing |
Generate Image
POST /api/v1/image/generate
Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Image description |
model | string | No | Model ID (default: flux-2-pro) |
width | number | No | Width in pixels (256-2048, Flux/fal.ai) |
height | number | No | Height in pixels (256-2048, Flux/fal.ai) |
aspect_ratio | string | No | 1:1, 3:4, 4:3, 9:16, 16:9 (Google/fal.ai) |
num_images | number | No | 1-4 images (Google Imagen only) |
image_size | string | No | 1K or 2K (Google Imagen only) |
seed | number | No | Reproducibility seed (Flux only) |
Response
Google Imagen Response
Google Imagen returns images as base64-encoded data (not URLs). The response includes base64 and mimeType fields instead of url.
Flux URL Expiry
Flux image URLs expire after 10 minutes. Download or cache results promptly.
Examples
Edit Image
POST /api/v1/image/edit
Request
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Edit instruction |
image_url | string | Yes | Source image URL |
model | string | No | Model ID (default: qwen-image-edit) |
seed | number | No | Reproducibility seed (Flux Kontext only) |