Skip to content

Quickstart

Generate your first image in 2 minutes.

Prerequisites

  • A Fluxpool.ai account (free — includes 50 generations)
  • Python 3.8+ or Node.js 18+ (or any HTTP client for cURL)

Step 1: Get your API key

Sign in to your dashboard. Your API key is on the main screen.

Your API key starts with fp_. Keep it secret. Don't commit it to version control.

dashboard — API Keys
Your API Key
fp_sk-xxxx••••••••••••••xxxx
→ Go to Dashboard

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_your_api_key"
)

response = client.images.generate(
    model="flux-1.1-pro",
    prompt="A dragon perched on a neon-lit Tokyo rooftop at midnight, cinematic lighting, 8K",
    size="1024x1024"
)

print(response.data[0].url)
Response
{
  "created": 1717200000,
  "data": [
    {
      "url": "https://cdn.fluxpool.ai/generations/abc123.png",
      "revised_prompt": null
    }
  ]
}

"A dragon on a neon-lit Tokyo rooftop, 8K"

flux-1.1-pro

Generated with flux-1.1-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, get a result via polling or webhook.

import time
import requests
from openai import OpenAI

client = OpenAI(
    base_url="https://api.fluxpool.ai/v1",
    api_key="fp_your_api_key"
)

# Submit video generation request
response = client.chat.completions.create(
    model="wan-video-2.1",
    messages=[{
        "role": "user",
        "content": "A koi fish transforming into a phoenix, slow motion, cinematic"
    }],
    extra_body={"video": {"resolution": "1280x720", "duration": 5}}
)

generation_id = response.id

# Poll for completion
while True:
    status = requests.get(
        f"https://api.fluxpool.ai/v1/generations/{generation_id}",
        headers={"Authorization": "Bearer fp_your_api_key"}
    ).json()

    if status["status"] == "completed":
        print(status["output"]["url"])
        break

    time.sleep(5)

Video generation takes 30–90 seconds depending on the model and duration. For production use, we recommend webhooks instead of polling. Learn more →

VIDEO
wan-video-2.1

Generated with wan-video-2.1 · 1280×720 · 5 seconds · ~45s generation time

Step 5: Switch models in one line

Change the model parameter. That's it. Same API, same format, different model.

Model Type Best For Cost
flux-1.1-pro Image Photorealism, prompt adherence $0.03/image
qwen-image-3-6-plus Image Asian aesthetics, text rendering $0.02/image
sdxl-1.0 Image Fast drafts, ControlNet $0.01/image
wan-video-2.1 Video Cinematic video, smooth motion $0.15/video
kling-v2 Video Character consistency $0.20/video
runway-gen3 Video Premium motion, coherence $0.50/video

Switch from Flux to Qwen in one line:

# Just change the model parameter
response = client.images.generate(
    model="qwen-image-3-6-plus",  # ← changed from "flux-1.1-pro"
    prompt="Anime warrior princess in bamboo forest, Studio Ghibli style",
    size="1024x1024"
)

Next steps

Ready to generate?

Start with 50 free generations. No credit card required.

Start generating →