Create an edited or extended image from one or more source images and a prompt. The endpoint follows the official OpenAI Images API request and response shape forDocumentation Index
Fetch the complete documentation index at: https://docs.ttapi.io/llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/images/edits.
Documentation translated from the official documentation.
Supported models include gpt-image-2, gpt-image-1.5, gpt-image-1, and dall-e-2.You can obtain your API key from the TTAPI Dashboard.
Input image references to edit. For GPT Image models, you can provide up to 16 images. Each object should provide either file_id or image_url.
Text prompt describing the desired edit. GPT Image models support up to 32,000 characters; dall-e-2 supports up to 1,000 characters.
The model to use for image editing.
gpt-image-1.5, gpt-image-1, gpt-image-2 Optional mask image reference. Provide exactly one of file_id or image_url.
Sets the transparency of the output image background. Applies only to GPT Image models. Choose transparent, opaque, or auto (default). Transparent backgrounds require png or webp output format.
transparent, opaque, auto Controls how closely the output preserves details from the input image. Choose high or low; defaults to low. Applies only to GPT Image models.
high, low Moderation level for GPT Image models. Choose low or auto.
low, auto Number of images to generate, default 1. Available range 1-10.
Compression level for generated images (0-100). Applies only to GPT Image models with output_format set to webp or jpeg; defaults to 100.
Return format for generated images. Applies only to GPT Image models. Choose png (default), jpeg, or webp.
png, jpeg, webp Number of partial images to return in the streaming response, from 0 to 3; defaults to 0. Available only when stream is true.
Image quality. auto (default) automatically selects the best quality for the model.
GPT Image models support high, medium, and low;
dall-e-2 only supports standard.
Return data format. Only dall-e-2 supports url or b64_json; URLs are valid for 60 minutes. GPT Image models always return b64_json.
url, b64_json Image size.
GPT Image models support 1024x1024, 1536x1024, 1024x1536, and auto (default);
dall-e-2 supports 256x256, 512x512, 1024x1024.
Whether to stream edit progress. When enabled, use partial_images to receive partial image events.
A unique identifier representing your end-user, which can help OpenAI monitor and detect abuse.
Request successful, returns Base64 format image generation results
Generation timestamp (seconds)
1713833628
Image generation result list
Token usage (must return for Base64 format)
{
"input_tokens": 50,
"input_tokens_details": { "image_tokens": 40, "text_tokens": 10 },
"output_tokens": 50,
"total_tokens": 100
}