AI image generation has evolved dramatically. This guide compares the leading image generation APIs available through Crazyrouter, helping you choose the right tool for your creative projects.
Supported Image Generation Models#
| Provider | Models | Price/Image | Strengths |
|---|
| OpenAI | dall-e-3 | $0.04 | Prompt understanding |
| Midjourney | mj_imagine, mj_variation | $0.30 | Artistic quality |
| Black Forest Labs | flux-pro, flux-kontext-pro | $0.275 | Photorealism |
| Ideogram | ideogram_generate_V_3 | $0.30 | Text rendering |
| Flux | flux-schnell, flux-dev | $0.05-0.15 | Speed, quality |
DALL-E 3 API#
Basic Image Generation#
from openai import OpenAI
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://crazyrouter.com/v1"
)
response = client.images.generate(
model="dall-e-3",
prompt="A futuristic cityscape at sunset with flying cars and neon lights",
size="1024x1024",
quality="hd",
n=1
)
print(response.data[0].url)
Midjourney API#
Submit Imagine Task#
curl -X POST "https://crazyrouter.com/mj/submit/imagine" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"prompt": "A majestic dragon flying over a medieval castle, cinematic lighting --ar 16:9 --v 6"
}'
Check Task Status#
curl "https://crazyrouter.com/mj/task/{task_id}/fetch" \
-H "Authorization: Bearer sk-your-api-key"
Midjourney Actions#
| Action | Model Name | Price |
|---|
| Imagine | mj_imagine | $0.30 |
| Variation | mj_variation | $0.30 |
| Upscale | mj_upscale | $0.15 |
| Blend | mj_blend | $0.30 |
| Describe | mj_describe | $0.15 |
| Zoom | mj_zoom | $0.30 |
| Pan | mj_pan | $0.30 |
| Video | mj_video | $0.80 |
Blend Images#
curl -X POST "https://crazyrouter.com/mj/submit/blend" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"base64Array": ["base64_image_1", "base64_image_2"]
}'
Flux Kontext API#
Flux Kontext excels at image editing and context-aware generation:
Flux Models Available#
| Model | Price | Use Case |
|---|
| flux-pro | $0.275 | High quality |
| flux-kontext-pro | $0.30 | Context editing |
| flux-kontext-max | $0.40 | Maximum quality |
| flux-pro-1.1-ultra | $0.35 | Ultra quality |
| flux-schnell | $0.05 | Fast generation |
| flux-dev | $0.15 | Development |
Text-to-Image#
curl -X POST "https://crazyrouter.com/fal-ai/flux-pro/kontext/text-to-image" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"prompt": "A professional headshot of a business executive in a modern office"
}'
Image Editing with Kontext#
curl -X POST "https://crazyrouter.com/fal-ai/flux-pro/kontext" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"prompt": "Change the background to a beach sunset",
"image_url": "https://example.com/original.jpg"
}'
Flux Kontext Max (Multi-Image)#
curl -X POST "https://crazyrouter.com/fal-ai/flux-pro/kontext/max/multi" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"prompt": "Combine these two characters in a fantasy scene",
"image_urls": ["https://example.com/char1.jpg", "https://example.com/char2.jpg"]
}'
Ideogram V3 API#
Ideogram excels at text rendering and logo design:
Ideogram Models#
| Model | Price | Use Case |
|---|
| ideogram_generate_V_3_DEFAULT | $0.30 | Standard |
| ideogram_generate_V_3_TURBO | $0.20 | Fast |
| ideogram_generate_V_3_QUALITY | $0.40 | High quality |
| ideogram_edit_V_3_DEFAULT | $0.30 | Editing |
| ideogram_remix_V_3_DEFAULT | $0.30 | Remixing |
| ideogram_reframe_V_3_DEFAULT | $0.30 | Reframing |
Generate Image#
curl -X POST "https://crazyrouter.com/ideogram/v1/ideogram-v3/generate" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"prompt": "A modern logo for a tech startup called NeuralFlow with clean typography",
"aspect_ratio": "1:1",
"style": "design"
}'
Edit Image#
curl -X POST "https://crazyrouter.com/ideogram/v1/ideogram-v3/edit" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"image": "base64_encoded_image",
"prompt": "Add a golden border around the logo"
}'
Replace Background#
curl -X POST "https://crazyrouter.com/ideogram/v1/ideogram-v3/replace-background" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"image": "base64_encoded_image",
"prompt": "Replace background with a gradient blue sky"
}'
Comparison Table#
| Feature | DALL-E 3 | Midjourney | Flux Kontext | Ideogram V3 |
|---|
| Price | $0.04 | $0.30 | $0.275-0.40 | $0.20-0.40 |
| Photorealism | Good | Excellent | Excellent | Good |
| Text Rendering | Good | Poor | Good | Excellent |
| Artistic Style | Good | Excellent | Good | Good |
| Image Editing | Limited | Limited | Excellent | Yes |
| Speed | Fast | Medium | Fast | Fast |
Pricing Summary#
| Model | Price per Image |
|---|
| dall-e-3 | $0.04 |
| mj_imagine | $0.30 |
| mj_upscale | $0.15 |
| flux-pro | $0.275 |
| flux-kontext-pro | $0.30 |
| flux-schnell | $0.05 |
| ideogram_generate_V_3_TURBO | $0.20 |
| ideogram_generate_V_3_QUALITY | $0.40 |
Pricing Disclaimer: The prices shown in this article are for demonstration purposes only and may change at any time. Actual billing will be based on the real-time prices displayed when you make your request.
Use Case Recommendations#
| Use Case | Recommended Model |
|---|
| Marketing materials | DALL-E 3 or Ideogram V3 |
| Artistic illustrations | Midjourney |
| Product photography | Flux Kontext |
| Logo design | Ideogram V3 |
| Image editing | Flux Kontext |
| Text in images | Ideogram V3 |
| Fast prototyping | Flux Schnell |
Python Helper Function#
from openai import OpenAI
import requests
client = OpenAI(
api_key="sk-your-api-key",
base_url="https://crazyrouter.com/v1"
)
default_headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/"
}
def generate_image(prompt, model="dall-e-3"):
if model == "dall-e-3":
response = client.images.generate(
model="dall-e-3",
prompt=prompt,
size="1024x1024"
)
return response.data[0].url
elif model == "midjourney":
headers = {
**default_headers,
"Authorization": "Bearer sk-your-api-key"
}
response = requests.post(
"https://crazyrouter.com/mj/submit/imagine",
headers=headers,
json={"prompt": prompt}
)
return response.json()
url = generate_image("A beautiful sunset over mountains")
print(url)
Getting Started#
- Sign up at Crazyrouter
- Get your API key from the console
- Choose the model that fits your use case
- Start generating images
For questions, contact support@crazyrouter.com