AITRE API Documents(English)
  1. Images Generations(Images)
AITRE API Documents(English)
  • AITRE Introduction
  • Project Description
  • Send Request
  • Openai's format(Chat)
    • Gpt-4o-image(Generate Image)
      POST
    • Chat Completions Interface
      POST
  • Audio Interface(Audio)
    • TTS(speech-to-text)
      POST
    • Transcriptions
      POST
    • Translations
      POST
  • Embeddings Interface(Embeddings)
    • Embeddings
    • Create Embeddings
      POST
  • Images Generations(Images)
    • Openai's format Gpt-image-1
      POST
    • Openai's format Flux
      POST
    • Openai's format DALL·E 3
      POST
  • Models Interface(Models)
    • Model
      GET
  • Auto Completions Interface(Completions)
    • Completions
      POST
  • MidJourney
    • Description
    • Fetch task by id
      GET
    • Action
      POST
    • Blend(image to image)
      POST
    • Describe (image to text)
      POST
    • Imagine (text to image/image to image)
      POST
    • Modal(Partial redrawing、ZOOM)
      POST
    • Shorten(prompt analysis)
      POST
  1. Images Generations(Images)

Openai's format Flux

POST
{{BASE_URL}}/v1/images/generations
[Image]( https://platform.openai.com/docs/api-reference/images )
Given prompts and/or input images, the model will generate new images.
Related Guide: [Image Generation]( https://platform.openai.com/docs/guides/images )
Create an image according to the prompts.

Request

Header Params
Authorization
string 
required
Provide your bearer token in the Authorization header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
prompt
string 
required
Text description of the required image. The maximum length is 1000 characters.
model
string 
required
A model used for image generation.
n
integer 
optional
The number of images to be generated. It must be between 1 and 10.
size
string 
optional
Generate the size of the image. It must be one of 256x256, 512x512, or 1024x1024.
Example
{
  "model": "flux",
  "prompt": "A cute baby sea otter",
  "n": 1,
  "size": "1024x1024"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '{{BASE_URL}}/v1/images/generations' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "flux",
    "prompt": "A cute baby sea otter",
    "n": 1,
    "size": "1024x1024"
  }'

Responses

🟢200Create image
application/json
Body
created
integer 
required
data
array [object {1}] 
required
url
string 
required
Example
{
  "created": 1589478378,
  "data": [
    {
      "url": "https://..."
    },
    {
      "url": "https://..."
    }
  ]
}
Modified at 2025-03-30 03:37:00
Previous
Openai's format Gpt-image-1
Next
Openai's format DALL·E 3
Built with