MaaS-Flux-1-schnell
Common Information
Parameter | Description | Example |
---|---|---|
basePath | The base path for calling the mass API, includes the fixed path/v1/ai | https://genaiapi.cloudsway.net/v2/ai |
endpointPath | A randomly generated path segment for calling the mass API | |
AccessKey | The access key for calling the mass API | RWxxxxxxxx0Gd |
taskId | The task ID for asynchronous image processing tasks | 1234abcd |
Generate Image
Request Method
POST
Request Path
{basePath}/v2/ai/{endpointPath}/images/generations
Request Headers
Parameter | Description | Example |
---|---|---|
Authorization | AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
Request Body
Field Name | Type | Required | Description | Example Value |
---|---|---|---|---|
prompts | string | Yes | Positive prompt words. | A beautiful and youthful high school girl is sitting in the classroom, with a bright smile on her face. |
batchsize | int | No | Number of generated images. Limit range: 1 to 8. default:1 | 1 |
aspect_ratio | String | No | Aspect ratio; supported values include:1:1、2:3、3:2、3:4、4:3、16:9、9:16 | 1:1 corresponds to 1024:1024 2:3 corresponds to 512:768 3:2 corresponds to 768:512 3:4 corresponds to 768:1024 4:3 corresponds to 1024:768 16:9 corresponds to 1280:720 9:16 corresponds to 720:1080 |
Step | int | Yes | step Limit range:4-10 | 4 |
seed | int | No | Random seed. default:0 |
0 |
Response
Field Name | Type | Description | Example Value |
---|---|---|---|
status | String | status | success |
taskId | String | task id |
Example
Request
curl --request POST \
--url https://genaiapi.cloudsway.net/v2/ai/lXynAhfbAiD/images/generations \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'content-type: application/json' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--data-raw '{
"prompts": "A beautiful and youthful high school girl is sitting in the classroom, with a bright smile on her face.",
"aspect_ratio": "2:3",
"batchsize": "2",
"step": 10
}'
Response
{
"status": "success",
"taskId": "3374b3b0-d069-4831-a76b-ebab4df14457"
}
Query Image Task Result
Request Method
GET
Request Path
{basePath}/v2/ai/{endpointPath}/images/tasks/{taskId}
Request Header
Parameter | Description | Example |
---|---|---|
Authorization | AccessKey Bearer ${AccessKey} |
Bearer RWxxxxxxxx0Gd |
Path Variables
Field Name | Type | Required | Description | Example Value |
---|---|---|---|---|
taskId | String | Yes | Task id | 3374b3b0-d069-4831-a76b-ebab4df14457 |
Response
Field Name | Type | Description | Example Value |
---|---|---|---|
status | String | Task status information. | |
completed | boolean | Whether completed. | |
imageUrls | list | Collection of image addresses. |
Example
Request
curl --location --request GET 'https://genaiapi.cloudsway.net/v2/ai/lXynAhfbOiD/images/tasks/3374b3b0-d069-4831-a76b-ebab4df14457 ' \
--header 'Authorization: Bearer ${AccessKey}' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'content-type: application/json' \
--header 'Accept: */*' \
--header 'Connection: keep-alive' \
--data-raw ''
Response
{
"status": "completed",
"completed": true,
"imageUrls": [
"http://xxxx.png"
]
}