You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "The text prompt describing the content, style, or composition of the image to be generated."
33
+
},
34
+
"negative_prompt": {
35
+
"type": "string",
36
+
"maxLength": 500,
37
+
"description": "The description of elements to avoid in the generated image."
38
+
},
39
+
"num_images": {
40
+
"type": "integer",
41
+
"minimum": 1,
42
+
"maximum": 4,
43
+
"default": 1,
44
+
"description": "The number of images to generate."
45
+
},
46
+
"image_size": {
47
+
"anyOf": [
48
+
{
49
+
"type": "object",
50
+
"properties": {
51
+
"width": {
52
+
"type": "integer",
53
+
"minimum": 512,
54
+
"maximum": 1440
55
+
},
56
+
"height": {
57
+
"type": "integer",
58
+
"minimum": 512,
59
+
"maximum": 1440
60
+
}
61
+
},
62
+
"required": [
63
+
"width",
64
+
"height"
65
+
],
66
+
"description": "For both height and width, the value must be a multiple of 32."
67
+
},
68
+
{
69
+
"type": "string",
70
+
"enum": [
71
+
"square_hd",
72
+
"square",
73
+
"portrait_4_3",
74
+
"portrait_16_9",
75
+
"landscape_4_3",
76
+
"landscape_16_9"
77
+
],
78
+
"description": "The size of the generated image."
79
+
}
80
+
],
81
+
"default": "landscape_4_3",
82
+
"description": "The size of the generated image."
83
+
},
84
+
"enhance_prompt": {
85
+
"type": "boolean",
86
+
"default": true,
87
+
"description": "Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment."
88
+
},
89
+
"watermark": {
90
+
"type": "boolean",
91
+
"default": false,
92
+
"description": "Add an invisible watermark to the generated images."
93
+
},
94
+
"seed": {
95
+
"type": "integer",
96
+
"minimum": 0,
97
+
"maximum": 2147483647,
98
+
"description": "The same seed and the same prompt given to the same version of the model will output the same image every time."
99
+
}
100
+
},
101
+
"required": [
102
+
"model",
103
+
"prompt"
104
+
],
105
+
"title": "alibaba/wan2.2-t2i-flash"
106
+
}
107
+
}
108
+
}
109
+
},
110
+
"responses": {
111
+
"200": {
112
+
"content": {
113
+
"application/json": {
114
+
"schema": {
115
+
"type": "object",
116
+
"properties": {
117
+
"data": {
118
+
"type": "array",
119
+
"nullable": true,
120
+
"items": {
121
+
"type": "object",
122
+
"properties": {
123
+
"url": {
124
+
"type": "string",
125
+
"nullable": true,
126
+
"description": "The URL where the file can be downloaded from.",
"description": "The base64-encoded JSON of the generated image.",
133
+
"example": null
134
+
}
135
+
}
136
+
},
137
+
"description": "The list of generated images."
138
+
},
139
+
"meta": {
140
+
"type": "object",
141
+
"nullable": true,
142
+
"properties": {
143
+
"usage": {
144
+
"type": "object",
145
+
"nullable": true,
146
+
"properties": {
147
+
"credits_used": {
148
+
"type": "number",
149
+
"description": "The number of tokens consumed during generation.",
150
+
"example": 120000
151
+
}
152
+
},
153
+
"required": [
154
+
"credits_used"
155
+
]
156
+
}
157
+
},
158
+
"description": "Additional details about the generation."
159
+
}
160
+
}
161
+
}
162
+
}
163
+
}
164
+
}
165
+
},
166
+
"x-hideTryItPanel": true,
167
+
"x-codeSamples": [
168
+
{
169
+
"lang": "cURL",
170
+
"source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n\"model\": \"alibaba/wan2.2-t2i-flash\",\n\"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }'"
171
+
},
172
+
{
173
+
"lang": "JavaScript",
174
+
"source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: 'alibaba/wan2.2-t2i-flash',\n prompt: 'A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.',\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
175
+
},
176
+
{
177
+
"lang": "Python",
178
+
"source": "import requests\n\nresponse = requests.post(\n\"https://api.aimlapi.com/v1/images/generations\",\n headers={\n\"Content-Type\":\"application/json\", \n\"Authorization\":\"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n\"model\":\"alibaba/wan2.2-t2i-flash\",\n\"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }\n)\n\ndata = response.json()\nprint(data)"
"description": "The text prompt describing the content, style, or composition of the image to be generated."
33
+
},
34
+
"negative_prompt": {
35
+
"type": "string",
36
+
"maxLength": 500,
37
+
"description": "The description of elements to avoid in the generated image."
38
+
},
39
+
"num_images": {
40
+
"type": "integer",
41
+
"minimum": 1,
42
+
"maximum": 4,
43
+
"default": 1,
44
+
"description": "The number of images to generate."
45
+
},
46
+
"image_size": {
47
+
"anyOf": [
48
+
{
49
+
"type": "object",
50
+
"properties": {
51
+
"width": {
52
+
"type": "integer",
53
+
"minimum": 512,
54
+
"maximum": 1440
55
+
},
56
+
"height": {
57
+
"type": "integer",
58
+
"minimum": 512,
59
+
"maximum": 1440
60
+
}
61
+
},
62
+
"required": [
63
+
"width",
64
+
"height"
65
+
],
66
+
"description": "For both height and width, the value must be a multiple of 32."
67
+
},
68
+
{
69
+
"type": "string",
70
+
"enum": [
71
+
"square_hd",
72
+
"square",
73
+
"portrait_4_3",
74
+
"portrait_16_9",
75
+
"landscape_4_3",
76
+
"landscape_16_9"
77
+
],
78
+
"description": "The size of the generated image."
79
+
}
80
+
],
81
+
"default": "landscape_4_3",
82
+
"description": "The size of the generated image."
83
+
},
84
+
"enhance_prompt": {
85
+
"type": "boolean",
86
+
"default": true,
87
+
"description": "Optional parameter to use an LLM-based prompt rewriting feature for higher-quality images that better match the original prompt. Disabling it may affect image quality and prompt alignment."
88
+
},
89
+
"watermark": {
90
+
"type": "boolean",
91
+
"default": false,
92
+
"description": "Add an invisible watermark to the generated images."
93
+
},
94
+
"seed": {
95
+
"type": "integer",
96
+
"minimum": 0,
97
+
"maximum": 2147483647,
98
+
"description": "The same seed and the same prompt given to the same version of the model will output the same image every time."
99
+
}
100
+
},
101
+
"required": [
102
+
"model",
103
+
"prompt"
104
+
],
105
+
"title": "alibaba/wan2.2-t2i-plus"
106
+
}
107
+
}
108
+
}
109
+
},
110
+
"responses": {
111
+
"200": {
112
+
"content": {
113
+
"application/json": {
114
+
"schema": {
115
+
"type": "object",
116
+
"properties": {
117
+
"data": {
118
+
"type": "array",
119
+
"nullable": true,
120
+
"items": {
121
+
"type": "object",
122
+
"properties": {
123
+
"url": {
124
+
"type": "string",
125
+
"nullable": true,
126
+
"description": "The URL where the file can be downloaded from.",
"description": "The base64-encoded JSON of the generated image.",
133
+
"example": null
134
+
}
135
+
}
136
+
},
137
+
"description": "The list of generated images."
138
+
},
139
+
"meta": {
140
+
"type": "object",
141
+
"nullable": true,
142
+
"properties": {
143
+
"usage": {
144
+
"type": "object",
145
+
"nullable": true,
146
+
"properties": {
147
+
"credits_used": {
148
+
"type": "number",
149
+
"description": "The number of tokens consumed during generation.",
150
+
"example": 120000
151
+
}
152
+
},
153
+
"required": [
154
+
"credits_used"
155
+
]
156
+
}
157
+
},
158
+
"description": "Additional details about the generation."
159
+
}
160
+
}
161
+
}
162
+
}
163
+
}
164
+
}
165
+
},
166
+
"x-hideTryItPanel": true,
167
+
"x-codeSamples": [
168
+
{
169
+
"lang": "cURL",
170
+
"source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n\"model\": \"alibaba/wan2.2-t2i-plus\",\n\"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }'"
171
+
},
172
+
{
173
+
"lang": "JavaScript",
174
+
"source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: 'alibaba/wan2.2-t2i-plus',\n prompt: 'A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.',\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
175
+
},
176
+
{
177
+
"lang": "Python",
178
+
"source": "import requests\n\nresponse = requests.post(\n\"https://api.aimlapi.com/v1/images/generations\",\n headers={\n\"Content-Type\":\"application/json\", \n\"Authorization\":\"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n\"model\":\"alibaba/wan2.2-t2i-plus\",\n\"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }\n)\n\ndata = response.json()\nprint(data)"
0 commit comments