Documentation Index
Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Midjourney is an async image model for high-quality text-to-image generation, reference-guided remixing, region editing, variation, and upscaling. Use this page when you are ready to call the API after trying Midjourney in the APIXO playground.| Capability | Value |
|---|---|
| Model ID | midjourney |
| Modes | text-to-image, image-to-image, upload-paint, vary, upscale |
| Prompt length | Non-empty. Route limits are up to 2000 characters or up to 6000 UTF-8 bytes; keep prompts under 2000 characters for portable requests. |
| Reference images | Use exactly 1 image for route-compatible image-to-image or upload-paint requests. Some routes can accept up to 2 images. |
| Aspect ratios | 1:1, 1:2, 2:1, 2:3, 3:2, 3:4, 4:3, 5:6, 6:5, 9:16, 16:9 |
| Speeds | fast, turbo; relaxed is accepted by validation but is not listed on public pricing |
| Result count | Usually 4 images for generation and variation, usually 1 image for upscale |
Endpoint and authentication
Base URL:| Method | Endpoint | Purpose |
|---|---|---|
POST | /generateTask/midjourney | Submit a Midjourney task |
GET | /statusTask/midjourney?taskId={taskId} | Poll task status and retrieve results |
Copy-paste async quickstart
This minimal request submits a text-to-image task and returns ataskId.
taskId; you need it to poll for the final result.
Poll for result
resultJson after state becomes success:
Request body
Text-to-image
Image-to-image
Upload-paint
Useupload-paint when you want to edit a specific region. If mask, canvas, and imgPos are omitted on compatible routes, the backend can auto-fill a full-image edit region from image_urls[0].
Vary
Upscale
Parameters
Result delivery mode. Use
async for polling with statusTask, or callback for webhook delivery.Required when
request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.Midjourney input parameters.
Response format
Submit task response
POST /generateTask/midjourney returns a task ID when the task is accepted:
API status code.
200 means the task was accepted.Human-readable status message.
Unique APIXO task identifier used with the status endpoint.
Status response fields
Unique APIXO task identifier.
Current task state:
pending, processing, success, or failed.JSON string containing the generated image URLs. Present when
state is success.Machine-readable failure code. Present when
state is failed.Human-readable failure message. Present when
state is failed.Task creation timestamp in Unix milliseconds.
Task completion timestamp in Unix milliseconds. Present after completion.
Processing duration in milliseconds. Present after completion.
Webhook callback mode
Use callback mode when your backend should receive the final result automatically instead of polling.Billing
Midjourney is billed per use. The selectedspeed determines the unit price. Public pricing currently lists fast and turbo.
| Speed | APIXO price | Market comparison |
|---|---|---|
fast | $0.15 / use | $0.30 / use |
turbo | $0.25 / use | $0.50 / use |
Latency and polling
Actual latency may vary by prompt complexity, mode, selected route, and current queue load.| Mode or speed | Typical generation time | Recommended first poll | Poll interval |
|---|---|---|---|
turbo generation | 15s-25s | 20s after task creation | 3s-5s |
fast generation | 30s-45s | 20s after task creation | 3s-5s |
vary or upscale | 15s-60s | 15s after task creation | 3s-5s |
429, slow down requests and retry with backoff. For account-level details, see System APIs.
Errors and troubleshooting
HTTP errors
| Code | Meaning | What to do |
|---|---|---|
400 | Invalid request body, mode, parameter, prompt, or image URL | Fix the request before retrying |
401 | Missing or invalid API key | Check the Authorization header |
402 | Insufficient balance or quota | Add balance or switch account/key |
403 | Key or route cannot access the model | Check permissions and route strategy |
429 | Rate limit or concurrency limit reached | Retry with exponential backoff |
500 | Server error | Retry with backoff |
502 | Upstream provider error | Retry with backoff |
504 | Upstream timeout | Retry or use callback mode for long-running jobs |
Task failure codes
| Fail code | Meaning | What to do |
|---|---|---|
PromptInvalid | Prompt is invalid or rejected by the provider | Rewrite the prompt and remove unsafe or malformed content |
MissingParameter | Required request parameters are missing | Check mode, prompt, speed, image_urls, taskId, and imageIndex |
SensitiveContentDetected | Input or output was flagged by safety checks | Change the prompt or source image |
InputOutputSensitiveContentDetected | The input or output was flagged as sensitive | Try different inputs |
Upload error | Image upload or image size validation failed | Use a public direct image URL and keep image files within supported limits |
Website TimeOut | MidJourney official website did not respond after multiple attempts | Retry later or use callback mode |
Task TimeOut | The upstream task became outdated or timed out | Retry the generation |
RateLimitExceeded | Upstream or APIXO rate limit was reached | Retry with exponential backoff |
Common fixes
| Symptom | Fix |
|---|---|
Invalid mode type | Use one of text-to-image, image-to-image, upload-paint, vary, or upscale. |
| Parameter is ignored | Use stable API field names: aspect_ratio, variety, stylization, and weirdness. |
| Prompt unexpectedly loses flags | Move Midjourney flags out of prompt; text after the first -- is stripped by the backend. |
taskId not found for vary or upscale | Use the APIXO task ID from a previous Midjourney result, not the upstream provider task ID. |
| Upload-paint fails to read image size | Use a public, directly fetchable source image URL. The backend reads image_urls[0] to fill default canvas and mask values. |
relaxed fails billing or routing | Use fast or turbo unless your account has explicit relaxed pricing enabled. |