curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A premium product photo of a silver espresso machine on a clean white studio background, realistic lighting, high detail",
"quality": "low",
"size": "1:1",
"resolution": "1K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2026-04-27T10:30:00"
}
}OpenAI
GPT Image 2 Generation
Generate and edit images with GPT Image 2
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": "gpt-image-2",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A premium product photo of a silver espresso machine on a clean white studio background, realistic lighting, high detail",
"quality": "low",
"size": "1:1",
"resolution": "1K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1757165031-uyujaw3d",
"status": "not_started",
"created_time": "2026-04-27T10:30:00"
}
}- After submission, a
task_idis returned. If you provide acallback_url, Vidgo API sends a POST request when the task becomesfinishedorfailed. - You can always retrieve the result with the unified Query Task Status endpoint.
GPT Image 2 Generation
Overview
Use Vidgo API to generate a single image from a prompt or edit one or more reference images with natural-language instructions. GPT Image 2 supports explicit quality tiers, ratio presets, custom dimensions, and1K, 2K, or 4K resolution control.
Available Models
- gpt-image-2 - Text-to-image generation from a prompt.
- gpt-image-2-edit - Image editing based on one or more
image_urlsand a text instruction.
Notes
input.promptis required and supports up to4000characters.input.qualityis optional:low,medium, orhigh. Default:low.input.sizeis optional. Supported values areauto,1:1,2:3,3:2,3:4,4:3,4:5,5:4,16:9,9:16,21:9, or a customWIDTHxHEIGHTvalue.input.resolutionis optional:1K,2K, or4K.gpt-image-2-editrequiresinput.image_urls.gpt-image-2does not acceptinput.image_urls.- Each request returns one image.
nis not supported for GPT Image 2 requests.
Resolution
Theresolution parameter controls the effective output resolution and credits cost.
| Resolution | Credits multiplier | Description |
|---|---|---|
1K | 1x | Standard resolution |
2K | 2x | High resolution |
4K | 4x | Ultra-high resolution for true 4K-supported sizes |
Billing by Quality
| Quality | 1K | 2K | 4K |
|---|---|---|---|
| Low | 2 credits | 4 credits | 8 credits |
| Medium | 3 credits | 6 credits | 12 credits |
| High | 12 credits | 24 credits | 48 credits |
Resolution Rules
- If
sizeis omitted or set toauto, the request is processed and billed as1K, even ifresolutionis provided. - Custom
WIDTHxHEIGHTsizes requireresolution2Kor4K. 4Kbilling applies only to16:9,9:16,21:9, or custom sizes with a3840-pixel edge.- A
4Krequest that does not meet the true 4K rule is billed at the effective2Ktier. - A custom size whose longest edge is
3840must useresolution: "4K".
Custom Size Constraints
Custom sizes useWIDTHxHEIGHT format, for example 2304x1536, and must satisfy all of the following:
- Width and height must both be divisible by
16. - The maximum edge length is
3840pixels. - The aspect ratio must not exceed
3:1. - Total pixel count must stay between
655,360and8,294,400.
Request Examples
### Generate Image
```bash
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header "Authorization: Bearer VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gpt-image-2",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "A premium product photo of a silver espresso machine on a clean white studio background, realistic lighting, high detail",
"quality": "low",
"size": "1:1",
"resolution": "1K"
}
}'
Edit Image
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header "Authorization: Bearer VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gpt-image-2-edit",
"callback_url": "https://your-domain.com/callback",
"input": {
"prompt": "Replace the background with a clean white studio backdrop and add a soft natural shadow while preserving the product shape",
"quality": "medium",
"size": "1:1",
"resolution": "2K",
"image_urls": [
"https://cdn.vidgo.ai/temp/reference-product.jpg"
]
}
}'
Response Flow
The submit endpoint returns atask_id, status, and created_time. If you provide callback_url, Vidgo API sends a POST request when the task reaches finished or failed.
Use the unified status endpoint to retrieve the final result:
curl --request GET \
--url https://api.vidgo.ai/api/generate/status/task-unified-1757165031-uyujaw3d \
--header "Authorization: Bearer VIDGO_API_KEY"
finished, the status response includes generated image file URLs in data.files. If the task fails, the status payload returns the failure details for troubleshooting.Authorizations
All API endpoints require Bearer Token authentication.
Get your API key from the API Key Management page and pass it in the request header:
Authorization: Bearer VIDGO_API_KEY
Body
application/json
GPT Image 2 model identifier. Use gpt-image-2 for prompt-based generation and gpt-image-2-edit when you need reference image URLs for editing.
Available options:
gpt-image-2, gpt-image-2-edit Example:
"gpt-image-2"
Input parameters for GPT Image 2 generation or editing on Vidgo API.
Show child attributes
Show child attributes
Webhook callback URL for finished or failed task notifications.
Example:
"https://your-domain.com/callback"