Create images based on text and image prompts. Sourced from the official OpenAI interface, supports models gpt-image-1, dall-e-2, dall-e-3. Documentation translated from official documentation. If you have integrated with the official documentation, you can use it directly. All input/output parameters and support are consistent.
You can obtain your API key from the TTAPI Dashboard.
Text description of the image. Maximum lengths: gpt-image-1 supports up to 32,000 characters, dall-e-2 supports up to 1,000 characters, dall-e-3 supports up to 4,000 characters.
Controls the transparency of generated image backgrounds.
This parameter only applies to gpt-image-1. Choose one of: transparent, opaque, or auto (default). When set to auto, the model automatically determines the optimal background.
If set to transparent, the output format must support transparency, so use png or webp.
transparent, opaque, auto Supported models
gpt-image-1, dall-e-2, dall-e-3 Controls the content moderation level for images generated by gpt-image-1. Choose low (for less restrictive filtering) or auto (default).
low, auto Number of images to generate, default 1.
Available range 1-10, dall-e-3 is fixed at 1
Compression level for generated images (0-100%). This parameter only applies to gpt-image-1 with output format webp or jpeg, defaults to 100.
Return image format. This parameter only applies to gpt-image-1. Options: png (default), jpeg, webp.
png, png, jpeg Image quality.
auto (default) automatically selects the best quality for the given model.
gpt-image-1 supports three qualities: high, medium, low.
dall-e-3 supports hd and standard.
dall-e-2 only supports standard.
Return data format.
dall-e-3 and dall-e-2 support url or b64_json. URLs are valid for 60 minutes, so cache immediately after retrieval.
gpt-image-1 only supports b64_json.
Image size.
gpt-image-1 options: 1024x1024, 1536x1024, 1024x1536, auto (default).
dall-e-2 options: 256x256, 512x512, 1024x1024.
dall-e-3 options: 1024x1024, 1792x1024, 1024x1792.
Note: Different sizes consume different TTAPI quotas.
Style of generated image. This parameter only applies to dall-e-3.
vivid (vivid), natural (natural)