Skip to content

FLUX.2 [pro]

Photorealistic images up to 4 megapixels from a prompt, or edits and combinations of up to 8 reference images, billed per megapixel.

  • by Black Forest Labs
  • Image
  • from $0.03/image
On this page

1.Call

OpenAI-compatible image generation; images are returned as cdn.ewest.ai URLs. Every response carries an x-request-id trace ID.

curl https://api.ewest.ai/v1/images/generations \
  -H "Authorization: Bearer $EWEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "ewest/flux-2-pro", "prompt": "a cozy cabin in the snow"}'

# → {"data": [{"url": "https://cdn.ewest.ai/img/…"}]}

2.Authentication

Send your API key in the Authorization: Bearer header, as the examples above do (clients built for the Anthropic API can use x-api-key). Create keys under API keys. Keep the key on your server, never in browser code. More in the authentication guide.

3.Files

This model edits images. Send up to 8 public https URLs in image_urls, or upload the files as multipart image fields to POST /v1/images/edits. See Files for limits and formats.

4.Schema

What you send and what comes back, for ewest/flux-2-pro. The output tables are read from the API's OpenAPI description.

Input

POST /v1/images/generations
  • modelstringRequired
    The model id, ewest/flux-2-pro.
  • promptstringRequired
    What to draw. Up to 10,000 characters.
  • sizestringOptional
    Image size in pixels. One of: 1024x1024, 2048x2048, 1280x720, 720x1280, 1024x768, 768x1024, 1536x1024, 1024x1536, 2048x1536, 1536x2048, 1920x1072, 1072x1920, 2560x1440, 1440x2560.
  • image_urlsarrayOptional
    Up to 8 public https image URLs to edit or combine.
  • response_formatstringOptionaldefault url
    url (on cdn.ewest.ai, kept 7 days) or b64_json.

Output

Returns an image. POST /v1/images/generations answers 200: The images. POST /v1/images/edits answers 200: The edited images.

  • createdintegerSometimes
    Unix seconds when the images were created.
  • dataarray of objectAlways
    The generated images, in order.
  • data[].urlstring (uri)Always
    Link to the image, on cdn.ewest.ai, kept for 7 days.
  • data[].b64_jsonstring (base64)Sometimes
    The image bytes, base64-encoded; only with response_format: b64_json.
  • data[].revised_promptstring or nullSometimes
    The prompt as the model rewrote it, where it does that; otherwise null or absent.
  • data[].widthintegerSometimes
    Width of the image in pixels; present for models that report the size of the stored image.
  • data[].heightintegerSometimes
    Height of the image in pixels; present together with width.
  • backgroundstring or nullSometimes
    Background setting reported by the model, if any.
  • output_formatstring or nullSometimes
    File format reported by the model, if any.
  • qualitystring or nullSometimes
    Quality level reported by the model, if any.
  • sizestring or nullSometimes
    Size reported by the model, if any.
  • usageobjectSometimes
    Token usage, for models that bill by tokens; zeros otherwise.
  • usage.total_tokensintegerSometimes
    Input plus output tokens.
  • usage.input_tokensintegerSometimes
    Tokens in the input.
  • usage.output_tokensintegerSometimes
    Tokens in the output.
  • usage.input_tokens_detailsobjectSometimes
    Breakdown of the input tokens.
  • usage.input_tokens_details.image_tokensintegerSometimes
    Tokens from input images.
  • usage.input_tokens_details.text_tokensintegerSometimes
    Tokens from the prompt.

Sample response

{
  "created": 1793530277,
  "data": [
    {
      "url": "https://cdn.ewest.ai/img/2026/11/01/7hq2xk9mpz.png"
    }
  ]
}

5.Details

Sizes
1024×1024, 2048×2048, 1280×720, 720×1280, 1024×768, 768×1024, 1536×1024, 1024×1536, 2048×1536, 1536×2048, 1920×1072, 1072×1920, 2560×1440, 1440×2560
Image editing
Yes, up to 8 input images
Output
Image URL on cdn.ewest.ai (kept 7 days)