# FLUX.1 [schnell] Text to Image - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/api-reference/model-apis-flux-1-schnell

# FLUX.1 [schnell] Text to Image

POST

/

v3beta

/

flux-1-schnell

Try it

FLUX.1 [schnell] Text to Image

cURL

```
curl --request POST \
--url https://api.novita.ai/v3beta/flux-1-schnell \
--header 'Authorization: &#x3C;authorization>' \
--header 'Content-Type: &#x3C;content-type>' \
--data '
{
"response_image_format": "&#x3C;string>",
"prompt": "&#x3C;string>",
"seed": 123,
"steps": 123,
"width": 123,
"height": 123,
"image_num": 123
}
'
```

```
import requestsurl = "https://api.novita.ai/v3beta/flux-1-schnell"payload = { "response_image_format": "&#x3C;string>", "prompt": "&#x3C;string>", "seed": 123, "steps": 123, "width": 123, "height": 123, "image_num": 123}headers = { "Content-Type": "&#x3C;content-type>", "Authorization": "&#x3C;authorization>"}response = requests.post(url, json=payload, headers=headers)print(response.text)
```

```
const options = { method: 'POST', headers: {'Content-Type': '&#x3C;content-type>', Authorization: '&#x3C;authorization>'}, body: JSON.stringify({ response_image_format: '&#x3C;string>', prompt: '&#x3C;string>', seed: 123, steps: 123, width: 123, height: 123, image_num: 123 })};fetch('https://api.novita.ai/v3beta/flux-1-schnell', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
```

```
&#x3C;?php$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => "https://api.novita.ai/v3beta/flux-1-schnell", 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([ 'response_image_format' => '&#x3C;string>', 'prompt' => '&#x3C;string>', 'seed' => 123, 'steps' => 123, 'width' => 123, 'height' => 123, 'image_num' => 123 ]), CURLOPT_HTTPHEADER => [ "Authorization: &#x3C;authorization>", "Content-Type: &#x3C;content-type>" ],]);$response = curl_exec($curl);$err = curl_error($curl);curl_close($curl);if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
```

```
package mainimport (	"fmt"	"strings"	"net/http"	"io")func main() {	url := "https://api.novita.ai/v3beta/flux-1-schnell"	payload := strings.NewReader("{\n \"response_image_format\": \"&#x3C;string>\",\n \"prompt\": \"&#x3C;string>\",\n \"seed\": 123,\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"image_num\": 123\n}")	req, _ := http.NewRequest("POST", url, payload)	req.Header.Add("Content-Type", "&#x3C;content-type>")	req.Header.Add("Authorization", "&#x3C;authorization>")	res, _ := http.DefaultClient.Do(req)	defer res.Body.Close()	body, _ := io.ReadAll(res.Body)	fmt.Println(string(body))}
```

```
HttpResponse&#x3C;String> response = Unirest.post("https://api.novita.ai/v3beta/flux-1-schnell") .header("Content-Type", "&#x3C;content-type>") .header("Authorization", "&#x3C;authorization>") .body("{\n \"response_image_format\": \"&#x3C;string>\",\n \"prompt\": \"&#x3C;string>\",\n \"seed\": 123,\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"image_num\": 123\n}") .asString();
```

```
require 'uri'require 'net/http'url = URI("https://api.novita.ai/v3beta/flux-1-schnell")http = Net::HTTP.new(url.host, url.port)http.use_ssl = truerequest = Net::HTTP::Post.new(url)request["Content-Type"] = '&#x3C;content-type>'request["Authorization"] = '&#x3C;authorization>'request.body = "{\n \"response_image_format\": \"&#x3C;string>\",\n \"prompt\": \"&#x3C;string>\",\n \"seed\": 123,\n \"steps\": 123,\n \"width\": 123,\n \"height\": 123,\n \"image_num\": 123\n}"response = http.request(request)puts response.read_body
```

200

```
{
"task": {
"task_id": "&#x3C;string>"
},
"images": [
{
"image_url": "&#x3C;string>",
"image_url_ttl": 123,
"image_type": "&#x3C;string>"
}
]
}
```

Generate images from text prompts using FLUX.1 [schnell].

Pricing: $0.003 * (Width * Height * Steps) / (1024*1024*4)

##

[​](#request-headers)

Request Headers

[​](#param-content-type)

Content-Type

string

required

Enum: `application/json`

[​](#param-authorization)

Authorization

string

required

Bearer authentication format, for example: Bearer {{API Key}}.

##

[​](#request-body)

Request Body

[​](#param-response-image-format)

response_image_format

string

The returned image type. Default is png.

Enum: `png` `webp` `jpeg`

[​](#param-prompt)

prompt

string

required

Text input required to guide the image generation, divided by `,` . Range [1, 1024].

[​](#param-seed)

seed

integer

required

A seed is a number from which Stable Diffusion generates noise, which, makes generation deterministic. Using the same seed and set of parameters will produce identical image each time. Range [0, 4294967295].

[​](#param-steps)

steps

integer

required

The number of denoising steps. More steps usually can produce higher quality images, but take more time to generate, Range [1, 100].

[​](#param-width)

width

integer

required

Width of image. Range [64, 2048].

[​](#param-height)

height

integer

required

Height of image. Range [64, 2048].

[​](#param-image-num)

image_num

integer

required

Images numbers generated in one single generation. Range [1, 8].

##

[​](#response)

Response

[​](#param-task)

task

object

Task information.

Show properties

[​](#param-task-id)

task_id

string

Task ID.

[​](#param-images)

images

object[]

Contains information about images associated with image-type tasks. This parameter provides detailed data on each image processed or generated during the task, such as file paths, metadata, or any image-specific attributes. It is returned only for tasks that involve image operations, facilitating enhanced tracking and management of image data.

Show properties

[​](#param-image-url)

image_url

string

Image URL.

[​](#param-image-url-ttl)

image_url_ttl

integer

Image expiration time in seconds.

[​](#param-image-type)

image_type

string

Image type.

Enum: `jpeg`, `png`, `webp`

##

[​](#example)

Example

request

```
curl --location 'https://api.novita.ai/v3beta/flux-1-schnell' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth. The word \"Novita AI\" is painted over it in big, white brush strokes with visible texture",
"width": 512,
"height": 512,
"seed": 2024,
"steps": 4,
"image_num": 1
}'
```

response

```
{
"images": [
{
"image_url": "https://model-api-output.5e61b0cbce9f453eb9db49fdd85c7cac.r2.cloudflarestorage.com/xxx",
"image_url_ttl": 604800,
"image_type": "png"
}
],
"task": {
"task_id": "xxx"
}
}
```

Last modified on December 3, 2025
