Quickstart
Generate your first image in 2 minutes.
Prerequisites
- • A Fluxpool.ai account (free — includes 50 credits)
- • Python 3.8+ or Node.js 18+ (or any HTTP client for cURL)
Step 1: Get your API key
Sign in to the Fluxpool app, open API / MCP Access, and click Create new key. Copy the key immediately — the full value is shown only once.
Your API key starts with fp_live_ followed by 40 hex characters. Keep it secret. Never commit it to version control or expose it in browser code.
Step 2: Install the SDK
Fluxpool uses an OpenAI-compatible API. Use the official OpenAI SDK — just change the base URL.
pip install openai Already using the OpenAI SDK? You're ready. Skip to Step 3.
Step 3: Generate an image
Eight lines of code. One image back.
from openai import OpenAI
client = OpenAI(
base_url="https://api.fluxpool.ai/v1",
api_key="fp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
response = client.images.generate(
model="flux-2-pro",
prompt="A dragon perched on a neon-lit Tokyo rooftop at midnight, cinematic lighting, 8K",
size="1024x1024"
)
print(response.data[0].url) {
"created": 1717200000,
"data": [
{
"url": "https://cdn.fluxpool.ai/generations/abc123.png",
"revised_prompt": null
}
]
} "A dragon on a neon-lit Tokyo rooftop, 8K"
Generated with flux-2-pro · 1024×1024 · ~3 seconds
Try different models by changing the model parameter. See all available models →
Step 4: Generate a video
Video generation is async. Submit a request, then poll the returned presigned URL (or the generation status endpoint) until the file is ready.
import time
import requests
API_KEY = "fp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Submit video generation request
response = requests.post(
"https://api.fluxpool.ai/v1/videos/generations",
headers=headers,
json={
"model": "seedance-v2",
"prompt": "A koi fish transforming into a phoenix, slow motion, cinematic",
"resolution": "720p",
"duration": 5
}
).json()
generation_id = response["id"]
video_url = response["data"][0]["url"] # S3 presigned URL (valid 1h)
# Poll the generation-status endpoint (or the presigned URL directly)
while True:
status = requests.get(
f"https://api.fluxpool.ai/v1/generations/{generation_id}",
headers=headers
).json()
if status["status"] == "completed":
print(status["data"][0]["url"])
break
time.sleep(3) Video generation takes 30–90 seconds depending on the model and duration. Poll /v1/generations/{id} or the presigned S3 URL every few seconds. Webhook delivery is on the roadmap. Learn more →
Generated with seedance-v2 · 1280×720 · 5 seconds
Step 5: Switch models in one line
Change the model parameter. That's it. Same API, same format, different model.
The authoritative list of available models is served by the API itself — call GET /v1/models to fetch what you can call today, then pass any returned id as the model parameter. Two verified examples to start with:
| Model | Type | Endpoint |
|---|---|---|
flux-2-pro | Image | /v1/images/generations |
seedance-v2 | Video | /v1/videos/generations |
Switch models in one line:
# Just change the model parameter
response = client.images.generate(
model="qwen-image-max", # ← changed from "flux-2-pro"
prompt="Anime warrior princess in bamboo forest, Studio Ghibli style",
size="1024x1024"
) Next steps
Image Generation Docs
Full endpoint reference, parameters, and advanced options.
→ Read docs 🎬Video Generation Docs
Async patterns, polling, and video-specific parameters.
→ Read docs 🔑Authentication
API key management, usage limits, and security best practices.
→ Read docs 🎮Try the Playground
Generate images and video in a visual interface. No code required.
→ Open Playground