Skip to main content
POST
  1. After submission, a task_id is returned. If you provide a callback_url, Vidgo API sends a POST request when the task becomes finished or failed.
  2. 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, and 1K, 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_urls and a text instruction.

Notes

  • input.prompt is required and supports up to 4000 characters.
  • input.quality is optional: low, medium, or high. Default: low.
  • input.size is optional. Supported values are auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 16:9, 9:16, 21:9, or a custom WIDTHxHEIGHT value.
  • input.resolution is optional: 1K, 2K, or 4K.
  • gpt-image-2-edit requires input.image_urls.
  • gpt-image-2 does not accept input.image_urls.
  • Each request returns one image.
  • n is not supported for GPT Image 2 requests.

Resolution

The resolution parameter controls the effective output resolution and credits cost.

Billing by Quality

Resolution Rules

  • If size is omitted or set to auto, the request is processed and billed as 1K, even if resolution is provided.
  • Custom WIDTHxHEIGHT sizes require resolution 2K or 4K.
  • 4K billing applies only to 16:9, 9:16, 21:9, or custom sizes with a 3840-pixel edge.
  • A 4K request that does not meet the true 4K rule is billed at the effective 2K tier.
  • A custom size whose longest edge is 3840 must use resolution: "4K".

Custom Size Constraints

Custom sizes use WIDTHxHEIGHT 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 3840 pixels.
  • The aspect ratio must not exceed 3:1.
  • Total pixel count must stay between 655,360 and 8,294,400.

Request Examples

Edit Image

Response Flow

The submit endpoint returns a task_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:
When the task is 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

Authorization
string
header
required

All API endpoints require Bearer Token authentication.

Get your API key from the API Key Management page and pass it in the request header:

Body

application/json
model
enum<string>
required

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
object
required

Input parameters for GPT Image 2 generation or editing on Vidgo API.

callback_url
string<uri>

Webhook callback URL for finished or failed task notifications.

Example:

"https://your-domain.com/callback"

Response

Task submitted successfully

code
integer
required
Example:

200

data
object
required