OhMyGPT API Docs
  1. Midjourney Open API
OhMyGPT API Docs
  • About This site
  • About new website
  • Midjourney Open API
    • About Midjourney Service
    • Midjourney Blend Image Generation Task Creation
      POST
    • Midjourney Text-to-Image Task Creation
      POST
    • Midjourney Execute Action Task Creation
      POST
    • Midjourney Query Specific Task ID Execution Status
      POST
    • Midjourney Paginated Bulk Query Tasks
      POST
    • Midjourney Describe Prompt Extraction Task Creation
      POST
    • Retrieve Images Generated by Midjourney from Object Storage
      GET
    • Retrieve Compressed Images Generated by Midjourney from Object Storage + WSRV
      GET
    • Retrieve Images Generated by Midjourney from Object Storage + WSRV
      GET
    • Proxy Discord Images via WSRV
      GET
    • Proxy and Compress Discord Images via WSRV
      GET
  • Management API
    • Create a New API Key
      POST
    • Update API Key Information
      POST
    • Query All of User's API Keys
      POST
    • Delete Specified API Key
      POST
    • Query User Membership Expiration Date
      POST
    • User Balance Query
      POST
    • Query the current model rates
      GET
  • OpenAI
    • About OpenAI Compatible API
    • About Azure OpenAI API
    • Audio
      • Text To Speech API
    • Chat
      • Chat Completion
      • Completion (Legacy)
    • Images
      • Create Image
    • Realtime API
  • Anthropic Claude
    • Deprecated
      • ChatCompletions
      • Claude2 API
    • Anthropic Official Claude API
  • Policies
    • Terms of Service
    • Privacy Policy
  • Other OpenAPIs
    • Search API
      • Google Custom Search API
      • Google Search By Serper
    • Azure API
      • Get Azure TTS voice list
      • Azure TTS
  1. Midjourney Open API

Midjourney Text-to-Image Task Creation

POST
/api/v1/ai/draw/mj/imagine
Midjourney imagine interface, you can execute the /imagine action through this interface.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/x-www-form-urlencoded
model
string 
required
Model name, currently can only be filled in as midjourney for key permission control
Example:
midjourney
prompt
string 
required
Prompt keywords, preferably in English (please do not input sensitive words)
Example:
chibi manga legend of vader anime vh1, in the style of miho hirano, dynamic and action-packed scenes, gaston bussière, chinese new year festivities, ross tran, charming character illustrations, light red and bronze --ar 73:88 --s 750 --niji 5
type
string 
optional
Select Mj drawing resource pool type, available options are NORMAL and FAST, default is FAST for ultimate drawing speed. Can be manually set to NORMAL for ultimate cost-effectiveness.
Example:
FAST
base64Array
array[string]
optional
Base64 array of padding images, used as reference images for AI-generated images. If you can provide online links for the images, it is recommended to directly add the image links in front of the Prompt, as this may not be reliable.
Example:
["data:image/webp;base64,Ukxxx","data:image/webp;base64,Ucxxx"]
webhook
string 
optional
Mj image generation callback address
Example:
https://webhook.site/ad24ae29-08e7-42a7-ae60-0aa157c77bdd

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 --request POST 'https://api.ohmygpt.com/api/v1/ai/draw/mj/imagine' \
--data-urlencode 'model=midjourney' \
--data-urlencode 'prompt=chibi manga legend of vader anime vh1, in the style of miho hirano, dynamic and action-packed scenes, gaston bussière, chinese new year festivities, ross tran, charming character illustrations, light red and bronze --ar 73:88 --s 750 --niji 5' \
--data-urlencode 'type=FAST' \
--data-urlencode 'base64Array=data:image/webp;base64,Ukxxx' \
--data-urlencode 'base64Array=data:image/webp;base64,Ucxxx' \
--data-urlencode 'webhook=https://webhook.site/ad24ae29-08e7-42a7-ae60-0aa157c77bdd'

Responses

🟢200成功
application/json
Body
statusCode
integer 
required
200为成功,400为失败
message
string 
required
data
integer 
required
任务ID
Example
{
    "statusCode": 200,
    "message": "Success",
    "data": 2
}
Previous
Midjourney Blend Image Generation Task Creation
Next
Midjourney Execute Action Task Creation
Built with