🟢DALL·E 3

TTAPI整合dalle3图片模型,让你能以更为优惠的价格且方便的方式集成到你的服务。

Dalle3 生成图像

POST https://api.ttapi.io/openai/v1/images/generations

根据文本提示使用DALL·E 3模型创建图像。DALL·E 3模型相对于市场上的其他模型而言对文字理解能力最强,你可以使用任何语言作为你的描述文案

Headers

Body

注意:dalle3接口的任务结果是同步返回的并不需要异步回调或者再次去查询该任务结果,接口响应时间一般在3-15s中间,时效同步根据OpenAI官方。

请求示例

import requests

endpoint = "https://api.ttapi.io/openai/v1/images/generations"

headers = {
    "TT-API-KEY": your_key
}

data = {
    "prompt": "a cute cat",
    "model": "1024x1024",
}

response = requests.post(endpoint, headers=headers, json=data)

print(response.status_code)
print(response.json())

返回示例

Dalle3 返回图片存在有效期限制,使用请自行转存图片

{
    "status": "SUCCESS",
    "message": "success",
    "data": {
        "created": 1713577682,
        "data": [
            {
                "revised_prompt": "A serene, domestic scene unfolding at dusk: a fluffy, long-haired tabby cat with piercing green eyes and distinctive black and white stripes curled up on a cozy, burgundy-colored velvet cushion. Around the cat is the warmth of a rustic country home, with wooden beams and a crackling fireplace. Light streams in through a large, arched window, painting the scene in the beautiful, ethereal light of golden hour.",
                "url": "https://dalleprodaue.blob.core.windows.net/private/images/cbb4adae-b889-4adf-9b84-4cd6d72d74fc/generated_00.png?se=2024-04-21T01%3A48%3A14Z&sig=th9fuLXfJVtLUOWu%2BfkJk1aY8abDZTDe7aIWJ1QzLkY%3D&ske=2024-04-26T13%3A43%3A10Z&skoid=f4f58869-78fa-4857-8a87-4ce5ae4ba8c3&sks=b&skt=2024-04-19T13%3A43%3A10Z&sktid=33e01921-4d64-4f8c-a055-5bdaffd5e33d&skv=2020-10-02&sp=r&spr=https&sr=b&sv=2020-10-02"
            }
        ]
    }
}

Last updated