Midjourney API
TT API's Midjourney API is the most stable and cost-effective Midjourney API
Mode
The Midjourney service of TT API supports three modes, fast, relax and turbo.
Fast mode response time is within 90 seconds, the overall success rate is over 98%
Relax mode response generally within 10 minutes, depending on the official response, the overall success rate is over 90%
Turbo mode response time is within 60 seconds
Generate[ /imagine ]
POST
https://api.ttapi.io/midjourney/v1/imagine
The imagine endpoint generates up to 4 images from a text prompt.
Headers
TT-API-KEY*
String
Your API Key in TT API used for request authorization
Content-Type
String
application-json
Request Body
prompt*
String
Prompt use to generate image. exp:a cat --ar 1:1
hookUrl
String
mode
String
timeout
int
Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds
getUImages
boolean
Whether to obtain four small pictures. The optional values are true and false. Default is false. Note: This operation does not actually means U operation on the generated task.
Example Request
Example Response
Action[ U1~U4 V1~V4... ]
POST
https://api.ttapi.io/midjourney/v1/action
This endpoint contains method used in TT Api. Eg: U1~U4, V1~V4 ...
Headers
TT-API-KEY*
String
Your API Key in TT API used for request authorization
Content-Type
String
application-json
Request Body
jobId*
String
The jobId in prev request
action*
String
variation1 means V1
hookUrl
String
timeout
int
Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds
Example Request
Example Response
Seeds[ --seed ]
POST
https://api.ttapi.io/midjourney/v1/seed
Get the seeds form midjourney image, refer to the midjourney's docs for usage
Headers
TT-API-KEY
String
Your API Key in TT API used for request authorization
Content-Type
String
application-json
Request Body
jobId*
String
The jobId in prev request
hookUrl
String
timeout
int
Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds
Example Request
Example Response
Blend [ /blend ]
POST
https://api.ttapi.io/midjourney/v1/blend
Upload 2-5 images and combine them into a new image based on the concept and aesthetic of each image.
Headers
TT-API-KEY
String
Your API Key in TT API used for request authorization
Content-Type
String
application-json
Request Body
imgBase64Array*
Array
Base64 array of images that will be used to generate mixed images
Array length is 2-5
Eg: [
"data:image/png;base64,xxx1", "data:image/png;base64,xxx2"
]
hookUrl
String
timeout
int
Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds
dimensions
String
Scale of generated image, including PORTRAIT
, SQUARE, LANDSCAPE. If not filled in, SQUARE is used by default.
PORTRAIT corresponds to the ratio 2:3
SQUARE corresponding ratio 1:1
LANDSCAPE corresponds to a ratio of 3:2
mode
String
Example Request
Example Response
Describe[ /describe ]
POST
https://api.ttapi.io/midjourney/v1/describe
Upload an image and generate four prompts based on the image.
Headers
TT-API-KEY
String
Your API Key in TT API used for request authorization
Content-Type
String
application-json
Request Body
base64*
String
base64 encoding of image
Eg: data:image/png;base64,xxx1
hookUrl
String
timeout
int
Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds
mode
String
Example Request
Example Response
Inpaint[ Vary(region) ]
POST
https://api.ttapi.io/midjourney/v1/inpaint
Partial modifies of the image.
Headers
TT-API-KEY
String
Your API Key in TT API used for request authorization
Content-Type
String
application-json
Request Body
Jobid*
String
The jobId in prev request
mask*
String
base64 encoding of image
Eg: UklGRrw0AABXRUJQVlA4WAoAAAAgAAAA...
prompt
String
Drawing prompt for selected areas
timeout
int
Request timeout, unit: seconds. If not filled in, the default timeout is 300 seconds
hookUrl
String
Example Request
Example Response
Fetch Job
GET
https://api.ttapi.io/midjourney/v1/fetch
to fetch the job result
Headers
TT-API-KEY
String
Your API Key in TT API used for request authorization
Request Body
jobId*
String
f5850038-90a3-8a97-0476-107ea4b8dac4
the result same as hookUrl result
Action Used In action endpoint
Async callback return json structure
Return body enumeration details
status
PENDING_QUEUE
ON_QUEUE
SUCCESS FAILED
progess
Completeness : 0-100
components
discordImage
Discord cdn image url
images
CDN address of TTAPI, four small pictures generated by the imagine command. This field is only valid with the imagine command, and the address will never be invalid.
Last updated