PopNowAPI
API-Schlüssel holen

FLUX 3 Klein API

von Black Forest Labs

Schnelle FLUX 3 Klein-Bilder und Edits mit mehreren Referenzen in 1K oder 2K

black-forest-labs/flux-3-klein/text-to-image
  • Bis 2K
  • Bis zu 10 Referenzbilder
  • 16 Seitenverhältnisse
  • Bild erstellen
  • Bild bearbeiten

Du rufst es mit dem Modellnamen black-forest-labs/flux-3-klein/text-to-image über POST /jobs/createTask auf, ab 0,012 $.

Modellnameblack-forest-labs/flux-3-klein/text-to-image
EndpunktPOST https://api.popnow.ai/api/v1/jobs/createTask
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "black-forest-labs/flux-3-klein/text-to-image",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "aspect_ratio": "1:1",
    "resolution": "1k",
    "output_format": "jpeg"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Der input ist aus dem Schema unten gebaut und besteht die Prüfung so, wie er dasteht. Ersetz Prompt und Links durch deine eigenen.

Preis

OptionUSD pro Bild
resolution 1K0,012 $
resolution 2K0,048 $

Abrechnung in USD · Alle Optionen und Preise: GET /models/black-forest-labs/flux-3-klein/text-to-image

Limits

Auflösungen
1K · 2K
Seitenverhältnisse
1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +10
Prompt-Länge (Zeichen)
5,000

Parameter

Diese Felder stammen aus demselben Schema, gegen das wir jede Anfrage prüfen. Nicht aufgeführte Felder werden abgelehnt.

  • promptstringPflicht

    Describe the subject, setting, light and style in plain sentences.

    Bereich
    1 – 5000 chars
  • aspect_ratiostringOptional

    Die Form des Bildes: breit, quadratisch oder hoch.

    Standardwert
    "1:1"
    Erlaubte Werte
    "1:1""16:9""9:16""4:3""3:4""3:2""2:3""4:5""5:4""21:9""9:21""2:1""1:2""3:1""1:3""custom"
  • resolutionstringOptionalÄndert den Preis

    Ausgabegröße. Größere Formate sind schärfer und kosten mehr.

    Standardwert
    "1k"
    Erlaubte Werte
    "1k""2k"
  • widthintegerOptional

    Output width in pixels when aspect_ratio is custom, 256 to 1024 (1024 if left out); height works the same way. The price still follows resolution.

    Bereich
    256 – 1024
  • heightintegerOptional

    Output height in pixels when aspect_ratio is custom, 256 to 1024 (1024 if left out); width works the same way. The price still follows resolution.

    Bereich
    256 – 1024
  • enable_prompt_expansionbooleanOptional

    Lässt das Modell einen kurzen Prompt mit Details ergänzen.

    Standardwert
    false
  • output_formatstringOptional

    Dateiformat des Ergebnisses.

    Standardwert
    "jpeg"
    Erlaubte Werte
    "jpeg""png""webp"
  • seedintegerOptional

    Dieselbe Zahl liefert ein wiederholbares Ergebnis.

    Bereich
    0 – 2147483647
Rohes JSON-Schema
{
  "type": "object",
  "required": [
    "prompt"
  ],
  "properties": {
    "seed": {
      "type": "integer",
      "maximum": 2147483647,
      "minimum": 0,
      "description": "Random seed for controlled comparisons."
    },
    "width": {
      "type": "integer",
      "maximum": 1024,
      "minimum": 256,
      "description": "Output width in pixels when aspect_ratio is custom, 256 to 1024 (1024 if left out); height works the same way. The price still follows resolution."
    },
    "height": {
      "type": "integer",
      "maximum": 1024,
      "minimum": 256,
      "description": "Output height in pixels when aspect_ratio is custom, 256 to 1024 (1024 if left out); width works the same way. The price still follows resolution."
    },
    "prompt": {
      "type": "string",
      "maxLength": 5000,
      "minLength": 1,
      "description": "Describe the subject, setting, light and style in plain sentences."
    },
    "resolution": {
      "enum": [
        "1k",
        "2k"
      ],
      "type": "string",
      "default": "1k",
      "description": "Output size tier: 1k is about one megapixel, 2k about four."
    },
    "aspect_ratio": {
      "enum": [
        "1:1",
        "16:9",
        "9:16",
        "4:3",
        "3:4",
        "3:2",
        "2:3",
        "4:5",
        "5:4",
        "21:9",
        "9:21",
        "2:1",
        "1:2",
        "3:1",
        "1:3",
        "custom"
      ],
      "type": "string",
      "default": "1:1",
      "description": "Output aspect ratio; custom lets you set width and height."
    },
    "output_format": {
      "enum": [
        "jpeg",
        "png",
        "webp"
      ],
      "type": "string",
      "default": "jpeg",
      "description": "File format of the returned image."
    },
    "enable_prompt_expansion": {
      "type": "boolean",
      "default": false,
      "description": "Rewrite the prompt into a fuller description before generating. Off by default, so the prompt is followed word for word."
    }
  },
  "additionalProperties": false
}

Antworten, Polling und Callbacks

Alle Modelle funktionieren gleich: Task anlegen, dann pollen oder auf den Callback warten.

Erst den Preis prüfen

cURL
curl -X POST https://api.popnow.ai/api/v1/jobs/quote \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "black-forest-labs/flux-3-klein/text-to-image",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "aspect_ratio": "1:1",
    "resolution": "1k",
    "output_format": "jpeg"
  }
}'

Sende vor dem Start denselben Anfrage-Body an POST /jobs/quote, um die geschätzten und maximalen Kosten in USD zu sehen. Die Preisabfrage führt keine Aufgabe aus und belastet dein Guthaben nicht.

Angenommen

HTTP
HTTP/1.1 202 Accepted

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "state": "queued"
  },
  "request_id": "req_example_create"
}

HTTP 202 bedeutet angenommen: Der USD-Höchstbetrag bleibt bis zur Abrechnung reserviert. Bei Annahme einer Aufgabe reservieren wir den maximalen Angebotsbetrag aus deinem API-Guthaben. Nach Abschluss rechnen wir den tatsächlichen Verbrauch ab, höchstens den reservierten Betrag, und geben den Rest frei. Schlägt die Aufgabe fehl, wird die Reservierung aufgehoben.

Status abfragen

cURL
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Frag alle paar Sekunden mit wachsendem Abstand ab und hör auf, sobald state succeeded, failed, canceled oder expired ist.

Fertiger Task

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "black-forest-labs/flux-3-klein/text-to-image",
    "state": "succeeded",
    "output": {
      "assets": [
        {
          "url": "https://cdn.popnow.ai/tasks/task_01k3m8x9q2z4v7n5p6r8s0t1w3/output.png?signature=FROM_RESPONSE",
          "expiresAt": "2026-10-17T12:20:00Z",
          "mime": "image/png",
          "width": 1024,
          "height": 1024
        }
      ]
    },
    "settled": true
  },
  "request_id": "req_example_record"
}

Lad über die url vor expiresAt herunter. Später einen frischen Link nötig? Frag POST /common/download-url.

Callback prüfen

Node.js
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const app = express();
// express.raw keeps the exact bytes that were signed; express.json would not match.
app.post("/hooks/popnow", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.header("X-Webhook-Timestamp");
  const signature = req.header("X-Webhook-Signature") ?? "";
  const body = JSON.parse(req.body.toString("utf8"));
  const taskId = body.data?.taskId ?? body.task_id;
  const digest = createHash("sha256").update(req.body).digest("hex");
  const expected = createHmac("sha256", process.env.POPNOW_WEBHOOK_SECRET)
    .update(`${taskId}.${timestamp}.${digest}`)
    .digest("base64");
  const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
  // Check the signature first, then reject anything older than five minutes.
  if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.status(401).end();
  res.status(200).end(); // answer fast, then fetch the task and store its files
});

Mit gesetzter callBackUrl schicken wir dir den fertigen Task. Prüf die Signatur am rohen Body, bevor du ihm vertraust.

Lokale Datei schicken

cURL
curl -X POST https://api.popnow.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png", "bytes": 482113}'

# PUT the file bytes to data.uploadUrl with every header in data.headers, then commit it:
curl -X POST https://api.popnow.ai/api/v1/files/$FILE_ID/commit \
  -H "Authorization: Bearer $POPNOW_API_KEY"
# The commit returns a popnow://f/... reference. Put it in any image, video or
# audio field of the task input instead of a public https URL.

Öffentliche https-Links funktionieren direkt. Lokale Dateien laufen vorher über upload-url und commit.

Über FLUX 3 Klein

Schnelle FLUX 3 Klein-Bilder und Edits mit mehreren Referenzen in 1K oder 2K.

Du rufst es mit dem Modellnamen black-forest-labs/flux-3-klein/text-to-image über POST /jobs/createTask auf, ab 0,012 $.

Anfrageparameter

ParameterPflichtBeschreibung
seedNeinDieselbe Zahl liefert ein wiederholbares Ergebnis. ≥ 0 · ≤ 2147483647
widthNeinOutput width in pixels when aspect_ratio is custom, 256 to 1024 (1024 if left out); height works the same way. The price still follows resolution. ≥ 256 · ≤ 1024
heightNeinOutput height in pixels when aspect_ratio is custom, 256 to 1024 (1024 if left out); width works the same way. The price still follows resolution. ≥ 256 · ≤ 1024
promptJaDescribe the subject, setting, light and style in plain sentences.
resolutionNeinAusgabegröße. Größere Formate sind schärfer und kosten mehr. 1k · 2k · Standardwert: 1k
aspect_ratioNeinDie Form des Bildes: breit, quadratisch oder hoch. 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 4:5 · 5:4 · 21:9 · 9:21 · 2:1 · 1:2 · 3:1 · 1:3 · custom · Standardwert: 1:1
output_formatNeinDateiformat des Ergebnisses. jpeg · png · webp · Standardwert: jpeg
enable_prompt_expansionNeinLässt das Modell einen kurzen Prompt mit Details ergänzen. Standardwert: false

Preise

Die Preise sind in USD angegeben. Die API nutzt ein separates Guthaben in US-Dollar. Website-Credits lassen sich dafür weder verwenden noch in API-Guthaben umwandeln. Auch die umgekehrte Übertragung ist nicht möglich. Bei Annahme einer Aufgabe reservieren wir den maximalen Angebotsbetrag aus deinem API-Guthaben. Nach Abschluss rechnen wir den tatsächlichen Verbrauch ab, höchstens den reservierten Betrag, und geben den Rest frei. Schlägt die Aufgabe fehl, wird die Reservierung aufgehoben.

OptionUSD pro Bild
resolution 1K0,012 $
resolution 2K0,048 $

Sende vor dem Start denselben Anfrage-Body an POST /jobs/quote, um die geschätzten und maximalen Kosten in USD zu sehen. Die Preisabfrage führt keine Aufgabe aus und belastet dein Guthaben nicht.

API-Schnellstart

Die FLUX 3 Klein API in drei Schritten aufrufen

  1. API-Schlüssel erstellen. Melde dich bei PopNow an und erstelle in der API-Konsole einen Schlüssel. Schlüssel beginnen mit sk-popnow-. API-Aufrufe nutzen dein separates Guthaben in US-Dollar.
  2. Anfrage senden. Sende POST /jobs/createTask mit model black-forest-labs/flux-3-klein/text-to-image und einem input-Objekt nach der Parametertabelle. Die Antwort enthält sofort eine Task-ID.
  3. Ergebnis abholen. Frage GET /jobs/recordInfo mit der Task-ID ab oder gib eine callBackUrl mit, dann schicken wir das Ergebnis dorthin. Lade die Ausgabelinks herunter, sobald die Aufgabe erfolgreich ist.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "black-forest-labs/flux-3-klein/text-to-image",
  "input": {
    "prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette",
    "aspect_ratio": "1:1",
    "resolution": "1k",
    "output_format": "jpeg"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Ersetze den Prompt und alle Links durch deine eigenen. Im Tab „API“ findest du die Referenz zu Antwort, Polling und Callback.

Fragen zur FLUX 3 Klein API

Was kostet die FLUX 3 Klein API?

FLUX 3 Klein gibt es ab 0,012 $ pro Bild – mit Bild erstellen, der günstigsten Aufgabe. Preise nach Option: 1K 0,012 $ pro Bild, 2K 0,048 $ pro Bild. Die API nutzt ein separates Guthaben in US-Dollar. Website-Credits lassen sich dafür weder verwenden noch in API-Guthaben umwandeln. Auch die umgekehrte Übertragung ist nicht möglich. Bei Annahme einer Aufgabe reservieren wir den maximalen Angebotsbetrag aus deinem API-Guthaben. Nach Abschluss rechnen wir den tatsächlichen Verbrauch ab, höchstens den reservierten Betrag, und geben den Rest frei. Schlägt die Aufgabe fehl, wird die Reservierung aufgehoben.

Wie lautet der Modellname von FLUX 3 Klein in der API?

Trag black-forest-labs/flux-3-klein/text-to-image für Bild erstellen; black-forest-labs/flux-3-klein/edit für Bild bearbeiten im Feld model von POST /jobs/createTask ein.

Welche Limits hat die FLUX 3 Klein API?

Auflösungen: 1K · 2K; Seitenverhältnisse: 1:1 · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +10; Prompt-Länge (Zeichen): 5,000. Anfragen außerhalb dieser Grenzen werden abgelehnt, bevor etwas abgebucht wird.

Mehr zu FLUX 3 Klein