apimaxDocs
DocsPricingConsole
API ReferenceIntegration GuideUser GuideChangelog

Music Series

Image Series

DOCMidjourney API Overview

Video series

Task Management

Error Code ReferenceQuery Task StatusGET

Account Management

Query Quota UsageGET

Docs / Image Series / Midjourney

Midjourneymj_blendmj_custom_zoommj_describemj_edits

Midjourney API Overview

Midjourney MJ Proxy-compatible API: endpoints, actions, per-call pricing, task states and error codes.

Overview#

The Midjourney API is compatible with the MJ Proxy protocol and covers the full set of actions: text-to-image, image-to-text, blends, upscales, variations, panning, inpainting, and video. All endpoints require Bearer token authentication and use an asynchronous task model: submissions return a task ID which you poll for results.

  • Submission endpoints live under /mj/submit/*; queries use GET /mj/task/:id/fetch
  • Each action maps to a billing model (mj_imagine, mj_describe, ...) billed per call
  • Button interactions on results (upscale, variation, ...) are submitted through the action field of /mj/submit/change

Quick Start#

Text-to-image:

cURL
curl --request POST \
  --url https://api.apimax.ai/mj/submit/imagine \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "a cute cat sitting on the grass --ar 16:9"
  }'

Response:

200
{
  "code": 1,
  "description": "Submit success",
  "result": "1791517439018579"
}

result is the task ID. Poll the task for progress and results:

cURL
curl 'https://api.apimax.ai/mj/task/1791517439018579/fetch' \
  --header 'Authorization: Bearer <token>'

When the task finishes, imageUrl holds the 4-grid result image and buttons lists the available follow-up interactions (their customId is used for subsequent action submissions).

Submission Endpoints#

EndpointDescriptionBilling model
POST /mj/submit/imagineText-to-image; generates 4 candidates per promptmj_imagine
POST /mj/submit/describeImage-to-text; reverse-engineers a prompt from an imagemj_describe
POST /mj/submit/blendBlends 2–5 imagesmj_blend
POST /mj/submit/shortenAnalyzes and shortens a promptmj_shorten
POST /mj/submit/changeFollow-up actions (upscale/variation/zoom, see below)per action
POST /mj/submit/modalSubmits modal interaction results (inpaint, etc.)mj_modal
POST /mj/submit/upload-discord-imagesUploads custom base imagesmj_upload
POST /mj/submit/videoImage-to-videomj_video
POST /mj/submit/editsImage editingmj_edits
GET /mj/task/:id/fetchFetch a single tasknot billed
POST /mj/task/list-by-conditionQuery tasks by conditionnot billed

Actions supported by change#

The request body carries action plus customId (from the result's buttons):

actionDescriptionBilling model
UPSCALEUpscales the selected imagemj_upscale
VARIATIONSubtle variationmj_variation
HIGH_VARIATION / LOW_VARIATIONStrong / subtle variationmj_high_variation / mj_low_variation
REROLLRe-rolls the same promptmj_reroll
ZOOMZooms out (outpaints)mj_zoom
CUSTOM_ZOOMCustom zoom (submission is free; billed on modal submit)mj_custom_zoom
PANExtends the image in a directionmj_pan
INPAINTInpainting (submission is free; billed on modal submit)mj_inpaint

Actions and Pricing#

All actions are billed per call (fast mode by default):

Billing modelActionPrice
mj_imagineText-to-image¥0.288/call
mj_describeImage-to-text¥0.036/call
mj_blendBlend¥0.288/call
mj_shortenPrompt analysis¥0.288/call
mj_upscaleUpscale¥0.024/call
mj_variation / mj_high_variation / mj_low_variationVariation¥0.288/call
mj_rerollReroll¥0.288/call
mj_zoom / mj_custom_zoomZoom / outpaint¥0.288/call
mj_panPan¥0.288/call
mj_inpaintInpaint (billed on modal submit)¥0.288/call
mj_modalModal submit¥0.288/call
mj_editsImage editing¥0.288/call
mj_uploadUpload base image¥0.012/call
mj_videoImage-to-video¥2.304/call

Task States#

SUBMITTED → IN_PROGRESS → SUCCESS / FAILURE

StateDescription
SUBMITTEDSubmitted, queued
IN_PROGRESSGenerating; progress is the percentage
SUCCESSFinished; imageUrl holds the result image
FAILUREFailed; failReason explains why; the charge is refunded automatically

Result image URLs are hosted upstream and expire after a while — persist them in time. Poll every 5–10 seconds and stop once a terminal state is reached.

Modes#

The default mode is fast. Append --relax (cheaper, slower) or --turbo (faster, pricier) to the prompt to switch modes; billing currently applies the fast rate uniformly regardless of the selected mode.

Error Handling#

codeDescription
1Success
4Request error: missing or malformed parameters, JSON parsing failure, billing pre-deduction failure (insufficient balance), task not found (task_no_found), etc.; see description for details
30Concurrency limit reached; retry later
5Other internal errors

Next steps

All docs
Nano Banana 2.1 Image GenerationGoogle Nano Banana 2.1 (Gemini) async image generation. Excels at multi-image blending, real-person references, and text rendering, with a thinking level option.Nano Banana 2 Lite Image GenerationAsynchronous image generation with Google Nano Banana 2 (Gemini), excelling at multi-image fusion, real-person references, and text rendering, with support for reasoning levels.Nano Banana Pro Image GenerationAsynchronous image generation with Google Nano Banana 2 (Gemini), excelling at multi-image fusion, real-person references, and text rendering, with support for reasoning levels.GPT Image 2 Image Generation/v1/images/async-generationsNano Banana 2 Image GenerationGoogle Nano Banana 2 (Gemini) async image generation. Excels at multi-image blending, real-person references, and text rendering, with support for thinking levels.Nano Banana Synchronous Image GenerationGemini image models (the nano-banana series) support OpenAI-compatible synchronous image generation and multipart image editing, return base64 by default, and work with the OpenAI SDK.
On this page
OverviewOverviewQuick StartSubmission EndpointsActions supported by changeActions and PricingTask StatesModesError HandlingNext steps