curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "flux-3-klein",
"input": {
"prompt": "A red fox in fresh snow at sunrise",
"size": "3:2",
"resolution": "2K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1792468800-example",
"status": "not_started",
"created_time": "2026-10-20T12:00:00"
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}Flux
Flux 3 Klein
Generate or edit images with reference images and output up to 4K.
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "flux-3-klein",
"input": {
"prompt": "A red fox in fresh snow at sunrise",
"size": "3:2",
"resolution": "2K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1792468800-example",
"status": "not_started",
"created_time": "2026-10-20T12:00:00"
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- After submission, a
task_idwill be returned. If you provided acallback_url, when the task status becomesfinishedorfailed, a POST request will be sent to thecallback_url. - Regardless of whether
callback_urlis provided, you can retrieve the response result through the unified Query Task Status endpoint.
Models
- flux-3-klein — Text-to-image generation
- flux-3-klein-edit — Image editing with up to 10 references
Features
- Generate 1–4 images per request in PNG, JPEG, or WebP.
- Choose 1K, 2K, or 4K output with an aspect ratio or exact pixel dimensions.
- Edit or combine up to 10 reference images.
Input modes
| Mode | Model | Input |
|---|---|---|
| Text to image | flux-3-klein | Describe the target image in prompt. |
| Image editing | flux-3-klein-edit | Supply prompt and 1–10 URLs in image_urls. |
Required parameters
prompt(string): Non-empty description of the complete target image, including the subject, framing, background, lighting, and desired edits.image_urls(array of strings): Required forflux-3-klein-editonly. Supply 1–10 publicly accessible HTTP(S) reference image URLs.
Optional parameters
size(string):1:1,4:3,3:4,16:9,9:16,3:2,2:3, or an exactWIDTHxHEIGHTvalue. Defaults to1:1in both modes.resolution(string):1K,2K, or4K. Defaults to1K; custom pixel dimensions require an explicit matching value.n(integer): Number of output images, from 1 through 4. Defaults to 1.output_format(string):png(default),jpeg, orwebp.enable_safety_checker(boolean): Enable content safety checking. Defaults totrue.
Size
For an aspect ratio,resolution sets the long edge to 1024, 2048, or 4096 pixels. The short edge follows the requested ratio and is rounded to the nearest multiple of 16.
For custom WIDTHxHEIGHT dimensions, each side must be 256–4096 pixels and divisible by 16. Supply resolution explicitly using the tier determined by the longer side:
| Longer side | Required resolution |
|---|---|
| 256–1024 pixels | 1K |
| Above 1024 through 2048 pixels | 2K |
| Above 2048 through 4096 pixels | 4K |
size: "1536x1024" requires resolution: "2K".
Examples
The OpenAPI examples include generation, reference editing, and custom dimensions.Notes
Keep all generation parameters insideinput; callback_url belongs at the request’s top level.Authorizations
All API endpoints require Bearer Token authentication.
Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a key.
Add it to the request header:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Generate or edit images with up to ten reference images and 1K, 2K, or 4K output.
Response
Task submitted successfully
Business status code. 200 means success; any other value means the request failed. Always check this field: some validation errors return HTTP 200 with code: 400 in the body.
200: Success400: Invalid request parameters401: Missing or invalid API key402: Insufficient credits403: Permission denied404: Resource not found408: Request timeout429: Rate limit exceeded500: Internal server error502: Upstream service error503: Service unavailable
See Error Codes for details.
Available options:
200, 400, 401, 402, 403, 404, 408, 429, 500, 502, 503 Example:
200