Skip to main content
POST
/
v1
/
ai
/
text-to-image
/
flux-2-turbo
curl --request POST \
  --url https://api.freepik.com/v1/ai/text-to-image/flux-2-turbo \
  --header 'Content-Type: application/json' \
  --header 'x-freepik-api-key: <api-key>' \
  --data '
{
  "prompt": "mountain landscape at golden hour with mist"
}
'
{
"data": {
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED"
}
}

Authorizations

x-freepik-api-key
string
header
required

Your Freepik API key. Required for authentication. Learn how to obtain an API key

Body

application/json
prompt
string
required

Text description of the image you want to generate.

FLUX.2 [turbo] is optimized for speed while maintaining good quality. Perfect for rapid prototyping and testing.

Performance:

  • Faster generation than Flux 2 Pro
  • Lower cost per generation
  • Great for iteration and experimentation

Tips:

  • Works best with clear, descriptive prompts
  • Adjust guidance_scale for prompt adherence
  • Use seed for reproducibility

Examples:

  • "mountain landscape at golden hour"
  • "portrait of a smiling person, natural lighting, soft focus"
  • "abstract geometric pattern with vibrant colors"
Example:

"a serene landscape with mountains and a lake at sunset"

guidance_scale
number
default:2.5

Controls how closely the model follows your prompt.

Range: 1.0 to 20.0 Default: 2.5

Guidelines:

  • Low (1-3): More creative freedom, less literal interpretation
  • Medium (3-7): Balanced between creativity and prompt accuracy
  • High (7-20): Strict adherence to prompt, less creative variation

Recommendation: Start with default (2.5) and adjust if needed.

Required range: 1 <= x <= 20
Example:

2.5

seed
integer | null

Random seed for reproducible results.

Valid range: 0 to 4,294,967,295 Default: Random (if not provided)

Tip: Save the seed from generations you like to create similar variations.

Required range: 0 <= x <= 4294967295
Example:

12345

image_size
object

Custom image dimensions (alternative to using standard aspect ratios).

Valid range: 512 to 2048 pixels for both width and height Default: 1024×1024 if not specified

Note: Total resolution affects cost and generation time.

enable_safety_checker
boolean
default:true

Enable content safety filtering.

When enabled: Filters potentially unsafe content (NSFW, violence, etc.) When disabled: No content filtering (use responsibly and in compliance with terms)

Recommendation: Keep enabled for production applications.

Example:

true

output_format
enum<string>
default:png

Output image format.

PNG:

  • Lossless compression
  • Supports transparency
  • Larger file size
  • Best for graphics and illustrations

JPEG:

  • Lossy compression
  • Smaller file size
  • No transparency
  • Best for photos and realistic images
Available options:
jpeg,
png
Example:

"png"

webhook_url
string<uri>

Optional callback URL that will receive asynchronous notifications whenever the task changes status. The payload sent to this URL is the same as the corresponding GET endpoint response, but without the data field.

Example:

"https://www.example.com/webhook"

Response

OK - Task created successfully

data
object
required
Example:
{
"task_id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"status": "CREATED"
}