xfusionai
  1. Images
xfusionai
  • 产品介绍
  • 模型价格
  • 快速开始
  • Azure语音服务
  • Azure翻译服务
  • Azure open AI
  • 常见问题
  • OpenAI API
    • About OpenAI Compatible API
    • Chat
      • Chat Completion
    • Images
      • Create Image
        POST
    • Audio
      • Text To Speech API
  • Midjourney Open API
    • About Midjourney and Prices
    • Submit Imagine Task
      POST
    • Specify ID Query Task (fetch)
      GET
    • Specify the ID List Query Task
      GET
    • Obtain the seed of the Task Image
      GET
    • Specify ID Query Task
      GET
    • Submit Blend Task
      POST
    • Submit Modal Task
      POST
    • Submit Describe Task
      POST
    • Submit Shorten Task
      POST
    • Submit FaceSwap Task
      POST
    • Upload Files to Discord
      POST
    • Submit Action Task(All associated button actions UPSCALE; VARIATION; REROLL; ZOOM, etc.)
      POST
  • Luma video
    • Luma Task Creation
      POST
    • Luma Expand Video
      POST
    • Luma Query Task
      GET
    • Luma Download video
      GET
  • Suno Music
    • Generate music
    • Query task
  • Anthropic Claude
    • Claude Chat Completion
  • Flux API
    • Create Image
  1. Images

Create Image

开发中
开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v1/images/generations
For more details, go to: https://platform.openai.com/docs/api-reference/images/create
Given a prompt and/or an input image, the model will generate new images.
1792x1024 (Dalle3 only)
1024 × 1792 (Dalle3 only)
1024x1024 (Dalle2, Dalle3)
512x512 (Dalle2 only)
256x256 (Dalle2 only)
Related Guide: Image Generation
Create an image according to the prompts.

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Header 参数
Authorization
string 
必需
示例值:
Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxx
Body 参数application/json
model
string 
必需
Model name.
示例值:
dall-e-3
prompt
string 
必需
A text description of the desired image. Maximum length is 1000 characters.
示例值:
cat
n
string 
必需
The number of images to generate. Must be between 1 and 10.
示例值:
1
size
string 
必需
The size of the generated image. Must be one of 256x256, 512x512 or 1024x1024.
示例值:
1024x1024
quality
string 
可选
示例值:
HD
response_format
string 
可选
示例值:
url
示例
{
    "prompt": "a dog",
    "model": "dall-e-3",
    "n": 1,
    "quality": "hd",
    "response_format": "url",
    "size": "1024x1024",
    ""
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v1/images/generations' \
--header 'Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "a dog",
    "model": "dall-e-3",
    "n": 1,
    "quality": "hd",
    "response_format": "url",
    "size": "1024x1024",
    ""
}'

返回响应

🟢200OK
application/json
Body
object {0}
示例
{
    "created": 1699693501,
    "data": [
        {
            "revised_prompt": "An adorable anime-style depiction of a girl. She has bright, expressive eyes, and long, flowing hair. Her outfit is a traditional seifuku school uniform with a sailor collar, pleated skirt, and knee-high socks. She is emanating positivity, with a wide smile on her face and cheerful, sparkling eyes. The color palette is soft and pastel, with a blend of soothing blues, gentle pinks, and calming whites. The background is filled with cherry blossom petals gently floating in the wind, adding a serene, peaceful atmosphere to the overall scene.",
            "url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-EDfhgsr4pmhirnnOUk3lXiHM/user-GSu4YoazFbISNTWmskEcrxQ5/img-lR4i8UJMvYeODOOebmRupWgO.png?st=2023-11-11T08%3A05%3A01Z&se=2023-11-11T10%3A05%3A01Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2023-11-10T21%3A40%3A03Z&ske=2023-11-11T21%3A40%3A03Z&sks=b&skv=2021-08-06&sig=Xwu5fpx7c0067pEZzT2ZxQYzahYdofmb0VCyoXVlzH8%3D"
        }
    ]
}
修改于 2024-11-09 17:14:40
上一页
Chat Completion
下一页
Text To Speech API
Built with