Base URL: https://api.apimart.aiAuth: Authorization: Bearer <token>New /v1/midjourney/... routes automatically inject model=midjourney; you do not need to pass model in the request body.
Quick start
# 1. Submit an Imagine job
curl -X POST https://api.apimart.ai/v1/midjourney/generations \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"prompt": "a cute cat, watercolor style --ar 16:9"}'
# 2. Poll the unified task API until status=completed
curl https://api.apimart.ai/v1/tasks/task_01JWXXXX \
-H "Authorization: Bearer <token>"
# 3. Upscale image 1
curl -X POST https://api.apimart.ai/v1/midjourney/generations/upscale \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"task_id": "task_01JWXXXX", "index": 1}'
API overview
See each feature’s sub-page for full fields, examples, and notes.
| Feature | Path | Doc |
|---|
| Text-to-image (default entry) | POST /v1/midjourney/generations | Imagine |
| Text-to-image (explicit entry) | POST /v1/midjourney/generations/imagine | Imagine |
| Multi-image blend | POST /v1/midjourney/generations/blend | Blend |
| Image to text (describe) | POST /v1/midjourney/generations/describe | Describe |
| Image edit | POST /v1/midjourney/generations/edits | Edits |
| Upscale a tile | POST /v1/midjourney/generations/upscale | Upscale |
| Variation | POST /v1/midjourney/generations/variation | Variation |
| High variation | POST /v1/midjourney/generations/high-variation | High Variation |
| Low variation | POST /v1/midjourney/generations/low-variation | Low Variation |
| Reroll | POST /v1/midjourney/generations/reroll | Reroll |
| Zoom out | POST /v1/midjourney/generations/zoom | Zoom |
| Pan | POST /v1/midjourney/generations/pan | Pan |
| Inpaint | POST /v1/midjourney/generations/inpaint | Inpaint |
| Modal parameters | POST /v1/midjourney/generations/modal | Modal |
| Image-to-video | POST /v1/midjourney/generations/video | Video |
| Remix (strong / subtle) | POST /v1/midjourney/generations/remix-strong · /remix-subtle | Remix |
| Task query | GET /v1/tasks/{task_id} · /v1/midjourney/{task_id} | Get task |
See also: Best practices (polling / retries / troubleshooting) · End-to-end workflows (curl walkthroughs + client wrappers)
End-to-end flow
Errors
{
"error": {
"type": "invalid_request_error",
"message": "prompt is required"
}
}
Common errors
| HTTP | type | Meaning |
|---|
| 400 | invalid_request_error | Bad parameters (missing required, wrong format, etc.) |
| 401 | authentication_error | Invalid API key |
| 402 | payment_required | Insufficient balance |
| 404 | not_found | Task not found |
| 429 | rate_limit_error | Rate limited |
| 500 | internal_error | Server error |
Task failures
Common fail_reason values:
Banned prompt detected — banned prompt content
Task timeout — task timeout (auto refund after 30+ minutes)
No available upstream — service temporarily unavailable, retry later
Billing
The unified model name for new MJ routes is midjourney. Billing keys are generated from action, version, and speed. The usual match order is:
midjourney@<action>-<version>-<speed>
-> midjourney@<action>-<version>
-> midjourney@<action>-<speed>
-> midjourney@<action>
-> midjourney
| Action | Bill name | Notes |
|---|
| Imagine | midjourney@imagine[-version][-speed] | Text-to-image / image-guided |
| Blend | midjourney@blend[-speed] | Multi-image blend |
| Describe | midjourney@describe[-speed] | Image to text |
| Edits | midjourney@edits[-speed] | Image edit |
| Upscale | midjourney@upscale[-version][-speed] | Upscale |
| Variation | midjourney@variation[-version][-speed] | Variation |
| High Variation | midjourney@high_variation[-version][-speed] | Strong variation |
| Low Variation | midjourney@low_variation[-version][-speed] | Subtle variation |
| Reroll | midjourney@reroll[-version][-speed] | Regenerate |
| Zoom | midjourney@zoom[-version][-speed] | Zoom out / outpaint |
| Pan | midjourney@pan[-version][-speed] | Pan outpaint |
| Inpaint | midjourney@inpaint[-version][-speed] | Inpaint entry |
| Modal | midjourney@modal[-speed] | Inpaint follow-up parameters |
| Video | midjourney@video / midjourney@video-720p | Image-to-video, charged × batch_size |
| Remix Strong | midjourney@remix_strong[-speed] | Strong reshape (v8 / v8.1 only) |
| Remix Subtle | midjourney@remix_subtle[-speed] | Subtle reshape (v8 / v8.1 only) |
Notes:
speed=relax or omitted speed does not add a speed suffix; fast / turbo add the corresponding suffix.
- Main versions normalize to
v8.1, v7, v6.1, v5.2, and v5.1.
niji=true + version=7/6 normalizes to niji7 / niji6.
See console pricing. Failed jobs are fully refunded.