curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "microsoft/mai-image-2.7-flash/text-to-image",
"input": {
"prompt": "A ceramic teapot on a linen tablecloth, soft window light, the label reads \"Morning Ritual\""
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}Microsoft
MAI Image 2.7 Flash Text to Image
The MAI Image 2.7 Flash Text to Image API quickly generates one image from a prompt at 1K or 2K, with 7 aspect ratios, custom sizes up to 4MP and transparent output.
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "microsoft/mai-image-2.7-flash/text-to-image",
"input": {
"prompt": "A ceramic teapot on a linen tablecloth, soft window light, the label reads \"Morning Ritual\""
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}- 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 result through the unified Query Task Status endpoint.
Models
- microsoft/mai-image-2.7-flash/text-to-image — Text-to-image with MAI Image 2.7 Flash, one image per request.
Features
- Seven aspect-ratio presets at
1K(about 1 megapixel) or2K(about 4 megapixels). - Custom
WIDTHxHEIGHTsizes up to 4,194,304 pixels. - Transparent backgrounds; PNG, JPEG or WebP output.
- Long prompts up to 32,000 characters.
Required parameters
prompt(string): Description of the image. 1–32,000 characters of text. Put exact on-image text in quotes.
Optional parameters
size(string): Aspect-ratio preset or customWIDTHxHEIGHT. Default1:1. See Size.resolution(string):1Kor2K. Default1K. Applies to aspect-ratio presets only.background(string):opaqueortransparent. Defaultopaque.transparentrequiresoutput_formatpngorwebp.output_format(string):png,jpegorwebp. Defaultpng.
Size
- Presets:
1:1,4:3,3:4,3:2,2:3,16:9,9:16. They use the selectedresolution:1Kis about 1 megapixel (1:1is 1024x1024),2Kis about 4 megapixels (16:9is 2720x1536). - Custom
WIDTHxHEIGHT(usexorX, for example3072x1344): both sides must be multiples of 16, each side at least 768 pixels, and total pixels at most 4,194,304. The image is rendered at exactly this size; other custom values return 400.resolutionapplies to presets.
Examples
- Square 1K image: a product still life with quoted label text, using the defaults.
- 16:9 at 2K: a landscape at about 4 megapixels (2720x1536).
- Transparent cutout: custom
3072x1344,background: transparent, WebP.
Notes
- Each request returns exactly one image.
inputaccepts the fields listed above; other fields return 400. Putmodelandcallback_urlat the request root, next toinput. background: transparentwithoutput_format: jpegreturns 400.- For edits with reference images, use MAI Image 2.7 Flash Edit.
- Credits are billed by tokens: prompt text tokens and output image tokens (output width × height / 1024). The price follows the output size, so
2Kand larger custom sizes cost more. The maximum for the request is reserved at submission; when the task finishes you are charged for the actual output size, up to that maximum, and the rest is refunded. A failed task is refunded in full. See the pricing page for current rates.
Body
application/json