Overview
High-quality image generation using the Flux 2 Pro model. Delivers strong results for both creative and photorealistic use cases with fast inference.
Primary Endpoint
POST
/api/v1/userFlux2/startStart Flux 2 Pro image generation or editing
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Name of the image generation task |
| prompt | string | Yes | Text prompt for image generation or editing instruction. |
| input_images | array<string> | No | Array of input image URLs for image-to-image editing or multi-image composition (up to 8 images). When provided, automatically switches to image-to-image mode for character consistency. |
| aspect_ratio | enum: 1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 2:3 | 3:2 | custom | match_input_image | No | Aspect ratio of the generated image. Options: 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, custom, match_input_image |
| resolution | enum: 1K | 2K | No | Resolution of the generated image. - 1K: ~1 megapixel - 2K: ~2 megapixels |
| force_generate | boolean | No | Force generation even if NSFW content is detected. Defaults to true for API users, false for web users |
| webhook_url | string | No | HTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth. |
| webhook_token | string | No | Optional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e. |
Request Example
curl -X POST "https://www.a2e.com.cn/api/v1/userFlux2/start" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Elon Musk and Mark Zuckerberg boxing",
"prompt": "Elon Musk and Mark Zuckerberg boxing in a professional ring",
"input_images": [
"https://example.com/reference1.jpg",
"https://example.com/reference2.jpg"
],
"aspect_ratio": "9:16",
"resolution": "1K",
"force_generate": true,
"webhook_url": "https://your-server.example.com/a2e/webhook",
"webhook_token": "a-shared-secret"
}'Related Endpoints
POST
/api/v1/userFlux2/startStart Flux 2 Pro image generation or editing
GET
/api/v1/userFlux2/listGet Flux 2 Pro task list
POST
/api/v1/userFlux2/batchDetailBatch query task details
GET
/api/v1/userFlux2/detail/{id}Get task details
DELETE
/api/v1/userFlux2/{id}Delete Flux 2 Pro task
Responses
200
Flux 2 Pro task started successfully or NSFW content detected
400
Invalid request parameters
401
Unauthorized - Invalid or missing token
402
Insufficient credits
500
Internal server error