The main function of the Midjourney Tasks API is to query the execution status of tasks by inputting the task ID generated by the Midjourney Imagine API or Midjourney Describe API. This document will provide detailed integration instructions for the Midjourney Tasks API, helping you easily integrate and fully utilize the powerful features of this API. With the Midjourney Tasks API, you can easily query the execution status of tasks from the Midjourney Imagine API or Midjourney Describe API.Documentation Index
Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
Use this file to discover all available pages before exploring further.
Application Process
To use the Midjourney Tasks API, you first need to apply for the corresponding service on the application page Midjourney Imagine API, and then copy the task ID from the Imagine API, as shown in the image:
If you are not logged in or registered, you will be automatically redirected to the login page inviting you to register and log in. After logging in or registering, you will be automatically returned to the current page.
There is a free quota available for first-time applicants, allowing you to use the API for free.
Request Example
The Midjourney Tasks API can be used to query the results of both the Midjourney Imagine API and the Midjourney Describe API. For information on how to use the Midjourney Imagine API, please refer to the documentation Midjourney Imagine API. For information on how to use the Midjourney Describe API, please refer to Midjourney Describe API. We will take a task ID returned by the Midjourney Imagine API as an example to demonstrate how to use this API. Suppose we have a task ID: 7489df4c-ef03-4de0-b598-e9a590793434, and we will demonstrate how to pass in a task ID.Task Example Image

Setting Request Headers and Request Body
Request Headers include:accept: Specifies that the response should be in JSON format, set toapplication/json.authorization: The key to call the API, which can be selected directly after application.
id: The uploaded task ID.ids: An array of task IDs for batch queries.action: The operation method for the task, supportingretrieve(single query) andretrieve_batch(batch query).

Code Example
It can be seen that various language codes have been automatically generated on the right side of the page, as shown in the image:
CURL
Python
Response Example
Upon successful request, the API will return the detailed information of the image task. For example:id: The ID of the image generation task, used to uniquely identify this image generation task.type: If type = imagine, it represents the result of the Midjourney Imagine API; if type = describe, it represents the result of the Midjourney Describe API.job_id: The ID of the image query task generated this time, used to uniquely identify this image query task.image_id: The unique identifier of the image task being queried, which needs to be passed when performing transformation operations on the image next time.request: The request information in the image query task.response: The return information in the image query task.
Batch Query Operation
This is for querying the details of multiple task IDs, and unlike the above, the action needs to be selected as retrieve_batch. Request Body includes:ids: An array of uploaded task IDs.action: The operation method for the task.

Code Example
It can be seen that various language codes have been automatically generated on the right side of the page, as shown in the figure:
Response Example
After a successful request, the API will return the specific details of all batch image tasks. For example:items, all specific details of batch image tasks. It is an array, and each element of the array has the same format as the return result of querying a single task above.count, the number of batch image tasks queried here.
CURL
Python
Error Handling
When calling the API, if an error occurs, the API will return the corresponding error code and message. For example:400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.

