Generate Images
Creates an image given a prompt. Learn more.
Authorization
Bearer
In: header
Request Body
application/json
The model to use for image generation. Must be one of dall-e-2, dall-e-3, or gpt-image-1. Defaults to dall-e-2 unless parameters specific to gpt-image-1 are used.
A text description of the desired image. Maximum length is 32000 characters for gpt-image-1, 1000 characters for dall-e-2, and 4000 characters for dall-e-3.
The number of images to generate. Must be between 1 and 10. For dall-e-3, only n=1 is supported.
The size of the generated image. For gpt-image-1, it must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default). For dall-e-2, it must be one of 256x256, 512x512, or 1024x1024. For dall-e-3, it must be one of 1024x1024, 1792x1024, or 1024x1792.
Allows transparency to be set for the background of the generated image. This parameter is supported only for gpt-image-1. It must be one of transparent, opaque, or auto (default). When auto is used, the model automatically determines the best background for the image.
If transparency is enabled, the output format must support transparency, so it should be set to png (default) or webp.
Controls the content moderation level for images generated by gpt-image-1. It must be either low for less restrictive filtering or auto (default).
The quality of the generated image.
Response Body
application/json
curl -X POST "https://router.bit-tech.com.cn/v1/images/generations/" \ -H "Content-Type: application/json" \ -d '{ "prompt": "string" }'{
"created": 0,
"data": [
{
"b64_json": "string",
"url": "string"
}
],
"usage": {
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
}
}How is this guide?