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)

Chat Completions Interface

POST
{{BASE_URL}}/v1/chat/completions
Given a prompt, the model will return the completion of one or more predictions and can also return the probability of alternative markers for each position.
The prompts and parameter creation provided have been completed
Provide your bearer token in the Authorization header when making requests to protected resources.
Example:
Authorization: Bearer ********************

Request

Header Params

Body Params application/json

Example
{
    "model": "gpt-4o-mini",
    "stream": false,
    "messages": [
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
}

Request Code 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 'Accept: application/json' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "gpt-4o-mini",
    "stream": false,
    "messages": [
        {
            "role": "user",
            "content": "Hello!"
        }
    ]
}'

Responses

🟢200OK
application/json
Body

Example
{
    "id": "chatcmpl-123",
    "object": "chat.completion",
    "created": 1677652288,
    "model": "gpt-4o-mini",
    "choices": [
        {
            "index": 0,
            "message": {
                "role": "assistant",
                "content": "\n\nHello there, how may I assist you today?"
            },
            "finish_reason": "stop"
        }
    ],
    "usage": {
        "prompt_tokens": 9,
        "completion_tokens": 12,
        "total_tokens": 21
    }
}
Modified at 2025-03-30 03:29:16
Previous
Gpt-4o-image(Generate Image)
Next
TTS(speech-to-text)
Built with