AITRE API Documents(English)
  1. MidJourney
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. MidJourney

Imagine (text to image/image to image)

POST
{{BASE_URL}}/mj/submit/imagine
After submitting the task, obtain the task ID (task_id) and use the query interface to check the task status.

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
botType
enum<string> 
required
botType,default:mj or niji
Allowed values:
MID_JOURNEYNIJI_JOURNEY
prompt
string 
prompt text
required
prompt text
base64Array
array[string]
Base64 array for cushion diagram
optional
Base64 array for cushion diagram
notifyHook
string 
callback url
optional
Callback url, use global notifyHook when empty
Example
{
  "botType": "MID_JOURNEY",
  "prompt": "Cat"
}

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}}/mj/submit/imagine' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "botType": "MID_JOURNEY",
    "prompt": "Cat"
}'

Responses

🟢200成功
application/json
Body
code
integer 
required
status: 1(success), 21(exist), 22(queue up), other(error)
description
string 
required
decription
properties
object 
required
extra param
result
integer 
required
Task ID
Example
{
  "code": 1,
  "description": "success",
  "properties": {},
  "result": 1320098173412546
}
Modified at 2025-03-30 04:14:44
Previous
Describe (image to text)
Next
Modal(Partial redrawing、ZOOM)
Built with