Skip to main content
POST
/
flux
/
generate
cURL
curl --request POST \
  --url https://api.ttapi.io/flux/generate \
  --header 'Content-Type: application/json' \
  --header 'TT-API-KEY: <api-key>' \
  --data '
{
  "prompt": "<string>",
  "mode": "flux1-dev",
  "size": "1024x1024",
  "aspect_ratio": "1:1",
  "hookUrl": "<string>"
}
'
{
  "status": "SUCCESS",
  "message": "success",
  "data": {
    "job_id": "job_id"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.ttapi.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

TT-API-KEY
string
header
required

You can obtain your API key from the TTAPI Dashboard.

Body

application/json

Note: The synchronous response from the Flux image generation endpoint is not the final result of the task. The final result needs to be received via asynchronous notification using the hookUrl parameter, or by querying through the Flux fetch task result endpoint.

prompt
string
required

Image description. Note: Flux supports multilingual understanding, but English performs best in testing.

mode
enum<string>
required

Model version

Available options:
flux1-dev,
flux1-pro,
flux-kontext-pro,
flux-kontext-max,
flux-2-pro,
flux-2-flex,
flux-2-max,
flux-2-klein-4b,
flux-2-klein-9b
Example:

"flux1-dev"

size
enum<string>

Image size

Available options:
1024x1024,
1024x1792,
1792x1024
Example:

"1024x1024"

aspect_ratio
enum<string>

Aspect ratio

Available options:
21:9,
16:9,
4:3,
3:2,
1:1,
2:3,
3:4,
9:16,
9:21
Example:

"1:1"

hookUrl
string

Callback notification URL

Response

Request successful

status
string
required
Example:

"SUCCESS"

message
string
required
Example:

"success"

data
object
required
Example:
{ "job_id": "job_id" }
Last modified on March 21, 2026