curl --request POST \ --url https://api.poyo.ai/api/generate/submit \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "flux-schnell", "callback_url": "https://your-domain.com/callback", "input": { "prompt": "A bright editorial photo of a compact electric bike in a modern city street", "size": "4:3", "n": 1, "output_format": "png" }}'
import requests
url = "https://api.poyo.ai/api/generate/submit"
payload = {
"model": "flux-schnell",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A bright editorial photo of a compact electric bike in a modern city street",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'flux-schnell',
callback_url: 'https://your-domain.com/callback',
input: {
prompt: 'A bright editorial photo of a compact electric bike in a modern city street',
size: '4:3',
n: 1,
output_format: 'png'
}
})
};
fetch('https://api.poyo.ai/api/generate/submit', 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.poyo.ai/api/generate/submit",
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([
'model' => 'flux-schnell',
'callback_url' => 'https://your-domain.com/callback',
'input' => [
'prompt' => 'A bright editorial photo of a compact electric bike in a modern city street',
'size' => '4:3',
'n' => 1,
'output_format' => 'png'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.poyo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"flux-schnell\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A bright editorial photo of a compact electric bike in a modern city street\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.poyo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"flux-schnell\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A bright editorial photo of a compact electric bike in a modern city street\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai/api/generate/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"flux-schnell\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A bright editorial photo of a compact electric bike in a modern city street\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}"
response = http.request(request)
puts response.read_body
FLUX.1 Schnell API 根据文本提示词快速生成图像。输出尺寸可以是预设比例、高清正方形或自定义 WIDTHxHEIGHT 值。
POST
/
api
/
generate
/
submit
提交 Flux Schnell 任务
curl --request POST \ --url https://api.poyo.ai/api/generate/submit \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "flux-schnell", "callback_url": "https://your-domain.com/callback", "input": { "prompt": "A bright editorial photo of a compact electric bike in a modern city street", "size": "4:3", "n": 1, "output_format": "png" }}'
import requests
url = "https://api.poyo.ai/api/generate/submit"
payload = {
"model": "flux-schnell",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A bright editorial photo of a compact electric bike in a modern city street",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'flux-schnell',
callback_url: 'https://your-domain.com/callback',
input: {
prompt: 'A bright editorial photo of a compact electric bike in a modern city street',
size: '4:3',
n: 1,
output_format: 'png'
}
})
};
fetch('https://api.poyo.ai/api/generate/submit', 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.poyo.ai/api/generate/submit",
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([
'model' => 'flux-schnell',
'callback_url' => 'https://your-domain.com/callback',
'input' => [
'prompt' => 'A bright editorial photo of a compact electric bike in a modern city street',
'size' => '4:3',
'n' => 1,
'output_format' => 'png'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.poyo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"flux-schnell\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A bright editorial photo of a compact electric bike in a modern city street\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.poyo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"flux-schnell\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A bright editorial photo of a compact electric bike in a modern city street\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai/api/generate/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"flux-schnell\",\n \"callback_url\": \"https://your-domain.com/callback\",\n \"input\": {\n \"prompt\": \"A bright editorial photo of a compact electric bike in a modern city street\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}"
response = http.request(request)
puts response.read_body