OpenAI
GPT Image 2 Generation
Generate and edit images with GPT Image 2
POST
Documentation Index
Fetch the complete documentation index at: https://docs.vidgo.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
Edit Image
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:
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_KEYBody
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.
Webhook callback URL for finished or failed task notifications.
Example:
"https://your-domain.com/callback"