FLUX Generate
Use DeerAPI to call the FLUX Generate endpoint with request details, response details, examples, and an OpenAPI playground.
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."
}'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())
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());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deerapi.com/flux/v1/{model}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A paper boat floating on calm water at sunrise.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deerapi.com/flux/v1/{model}"
payload := strings.NewReader("{\n \"prompt\": \"A paper boat floating on calm water at sunrise.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deerapi.com/flux/v1/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A paper boat floating on calm water at sunrise.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deerapi.com/flux/v1/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A paper boat floating on calm water at sunrise.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"polling_url": "<string>"
}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 theAuthorization header:
https://api.deerapi.com
Authorization: Bearer $DEERAPI_KEY
Model selection
Choose a current model ID from the live pricing page. 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, and503responses with exponential backoff.
Authorizations
Use a DeerAPI API Key as a Bearer token.
Headers
Must be application/json.
Path Parameters
Flux model variant to use, e.g. flux-pro-1.1, flux-pro, flux-dev, flux-pro-1.1-ultra.
Body
Text prompt describing the image to generate.
URL of a reference image to guide the generation style or content.
Output image width in pixels. Must be a multiple of 32. Range varies by model.
Output image height in pixels. Must be a multiple of 32. Range varies by model.
Number of diffusion steps. Higher values improve quality but increase latency.
When true, automatically enhances the prompt for more detailed results.
Random seed for reproducible outputs. Omit for random generation.
Guidance scale controlling how closely the output follows the prompt. Higher values increase prompt adherence.
Safety filter tolerance level. Higher values are more permissive. Range: 0–6.
Diversity interval. Higher values produce more varied outputs at the cost of prompt adherence.
Output image format. Supported values: jpeg, png.
URL to receive a POST notification when the task completes.
Secret string included in webhook payloads for request verification.
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."
}'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())
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());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deerapi.com/flux/v1/{model}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A paper boat floating on calm water at sunrise.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deerapi.com/flux/v1/{model}"
payload := strings.NewReader("{\n \"prompt\": \"A paper boat floating on calm water at sunrise.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deerapi.com/flux/v1/{model}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A paper boat floating on calm water at sunrise.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deerapi.com/flux/v1/{model}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A paper boat floating on calm water at sunrise.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"polling_url": "<string>"
}