Skip to content

Midjourney Imagine ​

Midjourney Imagine submits text-to-image tasks. Save the task ID, then query it for progress and results.

API Path ​

MethodologyPathReturns by
POST/mj/submit/imagineReturns the result of task and continues to require inquiries.

Example request ​

bash
curl https://moonnexai.com/mj/submit/imagine \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city at sunrise --ar 16:9",
    "notifyHook": "https://example.com/moonnexai/webhook"
  }'

Common field ​

fieldAnnotations
promptMidjourney protocol and parameters.
notifyHooktask status callback address.
stateThe business side custom pass field, which is based on API Reference.

task Processing ​

PhaseTreatment
Successful submissionSave task ID, prompt, user ID and business orders.
Task in progressShow queued or generating status and let the user refresh.
task completeReads the final picture URL and saves the original query result.
task failedDisplays failed information, maintains the re-submittal portal.

Access Recommendations ​

  • Saves the task ID submitted in response as the primary key for subsequent queries.
  • The user can display the state of queue, execution, completion, failure, etc.
  • Retain a task-query entry point even when callbacks are configured, so users can refresh results.

Relevant Pages ​