LinconwavesLinconwavesUnified docs
AI Workers

FLUX.1 Schnell (fast image) (Text to Image)

Generate images from text prompts via the Linconwaves AI Workers API.

FLUX.1 Schnell (fast image) (slug: flux-1-schnell) generates images from text prompts.

Endpoint

  • URL: POST /:modelSlug with modelSlug = flux-1-schnell
  • Auth: Authorization: Bearer <api_key>
  • Content-Type: application/json
  • Base URL: https://aiworker.linconwaves.com

Request

{
  "prompt": "A cozy cabin in the snow at sunset, cinematic lighting."
}

Notes:

  • Keep prompts concise for faster latency.

Response

  • Binary image stream (Content-Type: image/png or similar), or base64 image under image / result.image. Errors return JSON { "error": "...", "detail"?: "..." } with HTTP codes (400/401/499/500).

Curl example

curl -X POST https://aiworker.linconwaves.com/flux-1-schnell \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"prompt": "A cozy cabin in the snow at sunset, cinematic lighting."}' \
  --output flux-1-schnell.png

JavaScript (fetch)

const resp = await fetch('https://aiworker.linconwaves.com/flux-1-schnell', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
  body: JSON.stringify({
  "prompt": "A cozy cabin in the snow at sunset, cinematic lighting."
}),
});

if (resp.headers.get("content-type")?.includes("image")) {
  const buf = await resp.arrayBuffer();
  // use buf to save/display image
} else {
  const data = await resp.json();
  if (!resp.ok) {
    throw new Error(data.error || `Request failed (${resp.status})`);
  }
  const b64 = data.image || data.result?.image;
  if (typeof b64 === "string") {
    const bin = atob(b64);
    const bytes = new Uint8Array(bin.length);
    for (let i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i);
    const url = URL.createObjectURL(new Blob([bytes], { type: "image/png" }));
    // display or download via `url`
  }
}

Error codes

  • 401 Unauthorized — Missing/invalid API key.
  • 400 Bad Request — Invalid payload (e.g., missing prompt).
  • 499 Client Closed Request — Request aborted by client.
  • 500 — Upstream model error or unexpected failure.

Backend snippets

const BASE = 'https://aiworker.linconwaves.com';
const API_KEY = process.env.AIWORKER_API_KEY!;

const payload = {
  "prompt": "A cozy cabin in the snow at sunset, cinematic lighting."
};

const res = await fetch(`${BASE}/flux-1-schnell`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${API_KEY}` ,
  },
  body: JSON.stringify(payload),
});
const data = await res.json();
console.log(data);

Frontend snippets

// app/api/aiworker/route.ts
const BASE = 'https://aiworker.linconwaves.com';
const API_KEY = process.env.AIWORKER_API_KEY!;

export async function POST(req: Request) {
  const payload = await req.json();
  const res = await fetch(`${BASE}/flux-1-schnell`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization: `Bearer ${API_KEY}` ,
    },
    body: JSON.stringify(payload),
  });
  return new Response(await res.text(), { status: res.status, headers: res.headers });
}
  • Playground: Dashboard → Playground → select “FLUX.1 Schnell (fast image)”.
FLUX.1 Schnell (fast image) (Text to Image) | Linconwaves Docs