Get Image Details
curl --request GET \
--url https://api.fluxapi.ai/api/v1/flux/kontext/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fluxapi.ai/api/v1/flux/kontext/record-info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fluxapi.ai/api/v1/flux/kontext/record-info', 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.fluxapi.ai/api/v1/flux/kontext/record-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.fluxapi.ai/api/v1/flux/kontext/record-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fluxapi.ai/api/v1/flux/kontext/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluxapi.ai/api/v1/flux/kontext/record-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "task12345",
"paramJson": "{\"prompt\":\"A serene mountain landscape\",\"aspectRatio\":\"16:9\"}",
"completeTime": "2024-03-20T10:30:00Z",
"response": {
"originImageUrl": "https://example.com/original.jpg",
"resultImageUrl": "https://example.com/result.jpg"
},
"successFlag": 1,
"errorCode": null,
"errorMessage": "",
"createTime": "2024-03-20T10:25:00Z"
}
}Flux Kontext API
Get Image Details
Query the status and results of an image generation or editing task.
GET
/
api
/
v1
/
flux
/
kontext
/
record-info
Get Image Details
curl --request GET \
--url https://api.fluxapi.ai/api/v1/flux/kontext/record-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.fluxapi.ai/api/v1/flux/kontext/record-info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.fluxapi.ai/api/v1/flux/kontext/record-info', 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.fluxapi.ai/api/v1/flux/kontext/record-info",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.fluxapi.ai/api/v1/flux/kontext/record-info"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.fluxapi.ai/api/v1/flux/kontext/record-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluxapi.ai/api/v1/flux/kontext/record-info")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"taskId": "task12345",
"paramJson": "{\"prompt\":\"A serene mountain landscape\",\"aspectRatio\":\"16:9\"}",
"completeTime": "2024-03-20T10:30:00Z",
"response": {
"originImageUrl": "https://example.com/original.jpg",
"resultImageUrl": "https://example.com/result.jpg"
},
"successFlag": 1,
"errorCode": null,
"errorMessage": "",
"createTime": "2024-03-20T10:25:00Z"
}
}Status Descriptions
- 0: GENERATING - Task is currently being processed
- 1: SUCCESS - Task completed successfully
- 2: CREATE_TASK_FAILED - Failed to create the task
- 3: GENERATE_FAILED - Task creation succeeded but generation failed
Important Notes
- Generated images (resultImageUrl) will expire after 14 days
Authorizations
All APIs require authentication via Bearer Token.
Get API Key:
- Visit API Key Management Page to get your API Key
Usage: Add to request header: Authorization: Bearer YOUR_API_KEY
Note:
- Keep your API Key secure and do not share it with others
- If you suspect your API Key has been compromised, reset it immediately in the management page
Query Parameters
Unique identifier of the image generation task
Response
Request successful
Response status code
- 200: Success - Request has been processed successfully
- 401: Unauthorized - Authentication credentials are missing or invalid
- 404: Not Found - The requested resource or endpoint does not exist
- 422: Validation Error - The request parameters failed validation checks
- 429: Rate Limited - Request limit has been exceeded for this resource
- 455: Service Unavailable - System is currently undergoing maintenance
- 500: Server Error - An unexpected error occurred while processing the request
- 501: Generation Failed - Image generation task failed
Available options:
200, 401, 404, 422, 429, 455, 500, 501 Error message when code != 200
Example:
"success"
Show child attributes
Show child attributes