Quickstart
Generate your first image in 2 minutes.
Prerequisites
- • A Fluxpool.ai account (1-month Trial plan — 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
Twelve 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 night, rain, 8K",
size="1024x1024"
)
print(response.data[0].url) {
"id": "3f9b2c1e-8a4d-4f2b-9c6e-1d2a3b4c5d6e",
"status": "pending",
"model": "flux-2-pro",
"type": "image",
"estimated_credits": 3,
"credits_used": null,
"data": [
{
"url": "https://api.fluxpool.ai/v1/files/3f9b2c1e-8a4d-4f2b-9c6e-1d2a3b4c5d6e?e=…&s=…",
"s3_url": "https://…amazonaws.com/…",
"app_url": "https://app.fluxpool.ai/library?space=…&asset=3f9b2c1e-8a4d-4f2b-9c6e-1d2a3b4c5d6e",
"generation_id": "3f9b2c1e-8a4d-4f2b-9c6e-1d2a3b4c5d6e",
"status": "pending",
"revised_prompt": null
}
],
"created": 1767225600
} Trimmed: the full response also carries the size, file and thumbnail fields, filled in once the image is done. Generation runs in the background, so the first response says pending. url is a short download link that works for 24 hours and serves the image once it is ready. s3_url is the storage link behind it (1 hour), and app_url opens the image in the app. Check progress with GET /v1/generations/{id}.
Generated with Flux 2 Pro (flux-2-pro) · 1024×1024 · typically ~12s
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 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": "An origami crane unfolding its wings and taking flight from a desk, macro, soft window light",
"resolution": "720p",
"duration": 5
}
).json()
generation_id = response["id"]
video_url = response["data"][0]["url"] # short link, valid 24 hours; serves the file once ready
# Poll the generation-status endpoint until it is done
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) A video takes from seconds to minutes, depending on the model and duration. Poll /v1/generations/{id} every few seconds. Learn more →
Generated with Seedance 2.0 (seedance-v2) · 1280×720 · 5-second clip
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-2.0-pro", # ← 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 docsVideo Generation Docs
Async patterns, polling, and video-specific parameters.
→ Read docsAuthentication
API key management, usage limits, and security best practices.
→ Read docsTry the Playground
Generate images and video in a visual interface. No code required.
→ Open Playground