AITRE API Documents(English)
  1. Openai's format(Chat)
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. Openai's format(Chat)

Gpt-4o-image(Generate Image)

Developing
POST
{{BASE_URL}}/v1/chat/completions

Request

Header Params
Authorization
string 
optional
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
model
string 
required
stream
boolean 
required
messages
array [object {2}] 
required
role
string 
required
content
array [object {3}] 
required
Example
{
  "model": "gpt-4o-image",
  "stream": false,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "create a war cat"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
          }
        }
      ]
    }
  ]
}

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/chat/completions' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-4o-image",
    "stream": false,
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "create a war cat"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://github.com/dianping/cat/raw/master/cat-home/src/main/webapp/images/logo/cat_logo03.png"
                    }
                }
            ]
        }
    ]
}'

Responses

🟢200成功
application/json
Body
object {0}
Example
{}
Modified at 2025-04-06 11:01:27
Previous
Send Request
Next
Chat Completions Interface
Built with