> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.deerapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FLUX Generate

> Use DeerAPI to call the FLUX Generate endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the FLUX Generate workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/image/flux/post-generate.openapi.json POST /flux/v1/{model}
openapi: 3.1.0
info:
  title: flux generate image API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /flux/v1/{model}:
    post:
      summary: flux generate image
      operationId: flux_generate_image
      parameters:
        - name: model
          in: path
          required: true
          description: >-
            Flux model variant to use, e.g. `flux-pro-1.1`, `flux-pro`,
            `flux-dev`, `flux-pro-1.1-ultra`.
          schema:
            type: string
        - name: Content-Type
          in: header
          required: false
          description: Must be `application/json`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                prompt:
                  type: string
                  description: Text prompt describing the image to generate.
                  default: Hello
                image_prompt:
                  type: string
                  description: >-
                    URL of a reference image to guide the generation style or
                    content.
                width:
                  type: integer
                  description: >-
                    Output image width in pixels. Must be a multiple of 32.
                    Range varies by model.
                height:
                  type: integer
                  description: >-
                    Output image height in pixels. Must be a multiple of 32.
                    Range varies by model.
                steps:
                  type: integer
                  description: >-
                    Number of diffusion steps. Higher values improve quality but
                    increase latency.
                prompt_upsampling:
                  type: boolean
                  description: >-
                    When `true`, automatically enhances the prompt for more
                    detailed results.
                seed:
                  type: integer
                  description: >-
                    Random seed for reproducible outputs. Omit for random
                    generation.
                guidance:
                  type: number
                  description: >-
                    Guidance scale controlling how closely the output follows
                    the prompt. Higher values increase prompt adherence.
                safety_tolerance:
                  type: integer
                  description: >-
                    Safety filter tolerance level. Higher values are more
                    permissive. Range: 0–6.
                interval:
                  type: integer
                  description: >-
                    Diversity interval. Higher values produce more varied
                    outputs at the cost of prompt adherence.
                output_format:
                  type: string
                  description: 'Output image format. Supported values: `jpeg`, `png`.'
                webhook_url:
                  type: string
                  description: URL to receive a POST notification when the task completes.
                webhook_secret:
                  type: string
                  description: >-
                    Secret string included in webhook payloads for request
                    verification.
              default:
                prompt: A paper boat floating on calm water at sunrise.
            example:
              prompt: A paper boat floating on calm water at sunrise.
            examples:
              Default:
                summary: Default request
                value:
                  prompt: A paper boat floating on calm water at sunrise.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  polling_url:
                    type: string
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl https://api.deerapi.com/flux/v1/gemini-2.5-flash \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "prompt": "A paper boat floating on calm water at sunrise."
              }'
        - lang: Python
          label: requests
          source: |
            import os
            import requests

            url = "https://api.deerapi.com/flux/v1/gemini-2.5-flash"
            headers = {
                "Authorization": "Bearer " + os.environ["DEERAPI_KEY"],
                "Content-Type": "application/json",
            }
            payload = {
              "prompt": "A paper boat floating on calm water at sunrise."
            }

            response = requests.post(url, headers=headers, json=payload)
            print(response.json())
        - lang: JavaScript
          label: fetch
          source: >
            const response = await
            fetch("https://api.deerapi.com/flux/v1/gemini-2.5-flash", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "prompt": "A paper boat floating on calm water at sunrise."
              }),
            });


            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````