Overview
Generate images from natural language prompts using the platform's diffusion model pipeline. Describe what you want - style, composition, lighting - and receive high-resolution results.
Primary Endpoint
POST
/api/v1/userText2Image/startStart text to image generation
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | No | Name of the text to image task (optional, auto-generated if not provided) |
| prompt | string | Yes | Text prompt for image generation |
| width | number | No | Image width |
| height | number | No | Image height |
| model_type | enum: a2e | seedream | No | Model type to use for generation |
| input_images | array<string> | No | Reference images for A2E/Seedream model. A2E max 2 images; Seedream 5.0 Pro max 10 images. |
| skip_face_enhance | boolean | No | Whether to disable face similarity enhancement for A2E image edit. Defaults to false. |
| aspect_ratio | enum: 1:1 | 4:3 | 3:4 | 16:9 | 9:16 | 2:3 | 3:2 | 21:9 | No | Aspect ratio for Seedream model |
| max_images | integer | No | Maximum number of images to generate (creates multiple tasks internally) |
| 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/userText2Image/start" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Generated Image",
"prompt": "A beautiful sunset over mountains",
"width": 1024,
"height": 1024,
"model_type": "a2e",
"input_images": [
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
],
"skip_face_enhance": false,
"aspect_ratio": "1:1",
"max_images": 1,
"webhook_url": "https://your-server.example.com/a2e/webhook",
"webhook_token": "a-shared-secret"
}'Related Endpoints
POST
/api/v1/userText2Image/startStart text to image generation
GET
/api/v1/userText2Image/allRecordsGet all text to image records
POST
/api/v1/userText2Image/batchDetailBatch query task details
GET
/api/v1/userText2Image/{_id}Get text to image record detail
DELETE
/api/v1/userText2Image/{_id}Delete task
POST
/api/v1/userText2Image/quickAddAvatarQuick add avatar from generated image
Responses
200
Text to image task started successfully
400
Bad Request - Invalid parameters
401
Unauthorized - Invalid or missing bearer token