Flux-Kontext-Pro - Submit Task
Flux-Kontext-Pro — Submit Task. GPTProto API reference.
POST
/
flux
/
v1
/
flux-kontext-pro
flux-kontext-pro (submit task)
curl --request POST \
--url https://api.example.com/flux/v1/flux-kontext-proimport requests
url = "https://api.example.com/flux/v1/flux-kontext-pro"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/flux/v1/flux-kontext-pro', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/flux/v1/flux-kontext-pro",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/flux/v1/flux-kontext-pro"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/flux/v1/flux-kontext-pro")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/flux/v1/flux-kontext-pro")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyFlux’s official format for the submit task API.
curl --location --request POST 'https://gptproto.com/flux/v1/flux-kontext-pro' \
--header 'Authorization: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"prompt": "ein fantastisches bild",
"input_image": "base64_encoded_image",
"input_image_2": "base64_encoded_image",
"input_image_3": "base64_encoded_image",
"input_image_4": "base64_encoded_image",
"seed": 42,
"aspect_ratio": "21:9",
"output_format": "jpeg",
"webhook_url": "https://your-webhook-url.com",
"webhook_secret": "your_secret",
"prompt_upsampling": false,
"safety_tolerance": 2
}'
import requests
import json
url = "https://gptproto.com/flux/v1/flux-kontext-pro"
headers = {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"prompt": "ein fantastisches bild",
"input_image": "base64_encoded_image",
"input_image_2": "base64_encoded_image",
"input_image_3": "base64_encoded_image",
"input_image_4": "base64_encoded_image",
"seed": 42,
"aspect_ratio": "21:9",
"output_format": "jpeg",
"webhook_url": "https://your-webhook-url.com",
"webhook_secret": "your_secret",
"prompt_upsampling": False,
"safety_tolerance": 2
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(json.dumps(result, indent=2))
const url = "https://gptproto.com/flux/v1/flux-kontext-pro";
const headers = {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json"
};
const data = {
prompt: "ein fantastisches bild",
input_image: "base64_encoded_image",
input_image_2: "base64_encoded_image",
input_image_3: "base64_encoded_image",
input_image_4: "base64_encoded_image",
seed: 42,
aspect_ratio: "21:9",
output_format: "jpeg",
webhook_url: "https://your-webhook-url.com",
webhook_secret: "your_secret",
prompt_upsampling: false,
safety_tolerance: 2
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://gptproto.com/flux/v1/flux-kontext-pro"
payload := []byte(`{
"prompt": "ein fantastisches bild",
"input_image": "base64_encoded_image",
"input_image_2": "base64_encoded_image",
"input_image_3": "base64_encoded_image",
"input_image_4": "base64_encoded_image",
"seed": 42,
"aspect_ratio": "21:9",
"output_format": "jpeg",
"webhook_url": "https://your-webhook-url.com",
"webhook_secret": "your_secret",
"prompt_upsampling": false,
"safety_tolerance": 2
}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
req.Header.Set("Authorization", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"error": {
"message": "Invalid signature",
"type": "401"
}
}
{
"error": {
"message": "Insufficient balance",
"type": "403"
}
}
{
"error": {
"message": "Internal server error",
"type": "500"
}
}
{
"error": {
"message": "Input may not meet the guidelines. Please adjust and try again.",
"type": "503"
}
}
Request Body
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | ✅ Yes | - | The text prompt describing the image to generate |
input_image | string | ✅ Yes | - | Base64 encoded input image (first image) |
input_image_2 | string | ❌ No | - | Base64 encoded input image (second image) |
input_image_3 | string | ❌ No | - | Base64 encoded input image (third image) |
input_image_4 | string | ❌ No | - | Base64 encoded input image (fourth image) |
seed | integer | ❌ No | - | Random seed for reproducible generation |
aspect_ratio | string | ❌ No | 16:9 | Aspect ratio of the generated image. Options: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9 |
output_format | string | ❌ No | jpeg | Output image format. Options: jpeg, png, webp |
webhook_url | string | ❌ No | - | URL to receive webhook notifications when the task is completed |
webhook_secret | string | ❌ No | - | Secret key for webhook verification |
prompt_upsampling | boolean | ❌ No | false | Whether to enhance the prompt automatically |
safety_tolerance | integer | ❌ No | 2 | Safety tolerance level for content filtering. Range: 0-6 (0 = strict, 6 = permissive) |
⌘I

