SDKs & Libraries

Use the OpenAI SDK you already have. Change one line, keep the rest.

Overview

Fluxpool's API is OpenAI-compatible. The recommended integration path today is the official openai Python or Node.js SDK — verified end-to-end against production with the real npm package.

OpenAI SDK

Available

The official openai SDK works with Fluxpool for image generation and model listing. Video generation needs a raw HTTP request (see Video Generation) because the SDK doesn't have a video helper.

Installation

If you don't have the OpenAI SDK installed yet:

bash
pip install openai

Requires openai >= 1.0.0 (Python) or openai >= 4.0.0 (Node.js).

Image Generation

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.fluxpool.ai/v1",  # ← Only change
    api_key="fp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)

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

# response.data[0].url is an S3 presigned URL — poll until ready
print(response.data[0].url)

Replace the fp_live_... placeholder with your real key from API / MCP Access. See Authentication for details.

Listing Models

The OpenAI SDK's models.list() hits Fluxpool's GET /v1/models:

python
for m in client.models.list().data:
    print(m.id)

Video Generation

The OpenAI SDK does not have a videos helper. For video generation, POST directly to /v1/videos/generations:

python
import requests

response = requests.post(
    "https://api.fluxpool.ai/v1/videos/generations",
    headers={"Authorization": "Bearer fp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
    json={
        "model": "seedance-v2",
        "prompt": "A drone shot flying through cherry blossom trees",
        "duration": 5,
        "resolution": "720p"
    }
).json()

gen_id = response["id"]
# Poll /v1/generations/{gen_id} or the presigned URL until ready.

Full polling example: see the Video Generation guide.

Native Fluxpool SDKs

🚧

Coming soon

Dedicated Fluxpool packages for Python and Node.js are on the roadmap. They will add typed helpers for video polling, credit balance, the asset library, and the model catalog on top of the same OpenAI-compatible API.

Until then, the OpenAI SDK (above) covers image generation and model listing, and a small requests/fetch call covers video generation.

REST API

No SDK needed. Any HTTP client works.

curl
curl https://api.fluxpool.ai/v1/images/generations \
  -H "Authorization: Bearer fp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-2-pro",
    "prompt": "Product photo of sneakers on marble, studio lighting",
    "size": "1024x1024"
  }'

Base URL: https://api.fluxpool.ai/v1

Auth: Bearer token in Authorization header. Keys start with fp_live_.

Format: JSON request and response bodies.

Full API Reference →

Community libraries

No community-maintained Fluxpool packages are published yet. The OpenAI-compatible REST API works from any language that can speak HTTP — see the API Reference.

Building an integration? Email hi@fluxpool.ai and we'll link it here.

Need help?

Try the playground →