Image Generation
25+ models — Seedream 5.0, FLUX.2, Grok Imagine, WAN 2.6, Gemini. Text-to-image, img2img, inpainting, upscaling. From 0.7 cr/image.
Image API →
Image, video, music, 3D, chat — unified under a single endpoint. Ship creative AI features in minutes, not months.


from fotohub import FotoHub
client = FotoHub(api_key="fh_live_...")
# Generate an image — 1 credit, ~2 seconds
image = client.generate_image(
prompt="Product photography, white sneakers on marble, studio lighting",
model="seedream-5-0-260128",
aspect_ratio="1:1"
)
print(image["images"][0]) # → https://s3point.fotohub.app/...
# Let Gabriel pick the best model for you
route = client.gabriel_classify(
prompt="Make a 5s video of waves crashing on rocks",
enhance_prompt=True
)
# → { action: "route", target: "/generate/video", model_selected: "seedance-2-0-fast" }
# Stream chat completions (OpenAI-compatible, 35+ models)
for chunk in client.chat(
messages=[{"role": "user", "content": "Explain diffusion models in 3 sentences"}],
model="claude-sonnet-4-6",
stream=True
):
print(chunk["choices"][0]["delta"].get("content", ""), end="")avg 1.8s per image0ms downtime on failures<50ms from EU clients99.9% uptime SLA YOUR APP
┌─────────────────────────────────┐
│ from fotohub import FotoHub │
│ client.generate_image(...) │
└────────────────┬────────────────┘
│
HTTPS / TLS 1.3
│
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ EDGE LAYER │
│ WAF · DDoS Protection · Rate Limiting · GeoIP · Bot Detection │
└────────────────────────────────┬─────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ API GATEWAY │
│ Auth (JWT / API Key) · Credit Check · Tier Enforcement │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Validate │ → │ Deduct │ → │ Route │ → │ Select Provider │ │
│ │ Token │ │ Credits │ │ by Type │ │ (best avail.) │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────────────┘ │
└───────────┬──────────────┬──────────────┬───────────────┬───────────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌────────────────┐ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐
│ IMAGE ENGINE │ │ VIDEO ENGINE │ │ AUDIO ENGINE │ │ CHAT / LLM │
│ │ │ │ │ │ │ │
│ Seedream 5.0 │ │ Seedance 2.0 │ │ MiniMax │ │ Claude 4.6 │
│ FLUX.2 Pro │ │ Veo 3.1 │ │ Stable Audio │ │ GPT-5.1 │
│ Grok Imagine │ │ Sora 2 Pro │ │ ElevenLabs │ │ DeepSeek V4 │
│ WAN 2.6 │ │ Hailuo │ │ Chatterbox │ │ Grok 4.1 │
│ Gemini 3 │ │ Grok Video │ │ IDA Music │ │ Qwen3 Max │
└───────┬────────┘ └───────┬────────┘ └───────┬────────┘ └───────┬────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌──────────────────────────────────────────────────────────────────────────┐
│ RESPONSE PIPELINE │
│ │
│ CDN Upload → Signed URL → Webhook Notify → Usage Logged → Return │
│ │
│ On failure: auto-retry with next provider → refund credits if failed │
└──────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ { "images": ["https://..."], │
│ "credits_used": 1, │
│ "generation_time_ms": 1840 │
│ } │
└─────────────────────────────────┘
One API key. One SDK. Automatic failover between providers — your users never see errors.
pip install fotohubPython 3.8+ · PyPInpm install fotohubNode 18+ · npmcomposer require fotohub/sdkPHP 8.1+ · Packagist