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"
  }
}

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 interface 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 interface.

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-schnell,
flux1-pro,
flux-kontext-pro,
flux-kontext-max,
flux-2-pro,
flux-2-flex,
flux-2-max
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 13, 2026