DALL·E 3 API

💡

The fee of TTAPI DALL·E 3 API is 25% of the openai official price

Generate image (sync)

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


Partial modifies of the image.

Headers

NameTypeDescription
TT-API-KEY*StringYour API Key in TT API used for request authorization

Request Body

NameTypeRequiredDescription
promptStringtruePrompt use to generate image
sizeStringtrueImage Size:
1024x1024
1024x1792
1792x1024
modelStringfalsedall-e-3
nIntfalsegenerate images number only can ues 1 in dall-e-3
qualityStringfalsePicture quality, optional range:
standard, hd

Example Request

import requests
endpoint = "https://api.ttapi.io/openai/v1/images/generations"
headers = {
    "TT-API-KEY": your_key
}
data = {
    "prompt": "a cat",
    "size": "1024x1024"
}
response = requests.post(endpoint, headers=headers, json=data)
print(response.status_code)
print(response.json())

Example Response

There are expiration restrictions on the images returned by Dalle3. Please transfer the images yourself when using them.

{
    "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"
            }
        ]
    }
}