Midjourney task
Midjourney uses task-based APIs. Save the task ID after submission, then query status and results. Configure callbacks where possible and retain polling.
Route List
| Methodology | Path | Purpose |
|---|---|---|
POST | /mj/submit/imagine | Submit Imagine task. |
POST | /mj/submit/action | Submits action task. |
POST | /mj/submit/blend | Submits a mixed figure task. |
POST | /mj/submit/describe | Submit description task. |
POST | /mj/submit/modal | Submit Modal task. |
POST | /mj/submit/shorten | Submit a prompt-shortening task. |
POST | /mj/submit/video | Submit video task. |
GET | /mj/task/{id}/fetch | Query single task. |
POST | /mj/task/list-by-condition | Batch query task. |
GET | /mj/task/{id}/image-seed | Look for pictures. |
Commit Imagine
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"
}'Query task
bash
curl https://moonnexai.com/mj/task/task_xxx/fetch \
-H "Authorization: Bearer <MOONNEXAI_API_KEY>"Access Recommendations
- Saves the task ID of the response submission.
- The same task is treated, etc., to avoid duplication of effort.
- Saves the final picture URL and original response after task has been completed.
- When callback fails, the user is allowed to access the results through task queries.