Midjourney · Niji · 14 operations
Midjourney API
Call Midjourney over HTTP: one prompt returns a grid of four, then upscale, vary, zoom out or repaint a region. Imagine is $0.0595 per call and upscales and describe are $0.0298, with unlimited concurrency.
- Imagine $0.0595 / call
- Upscale $0.0298 / call
- Operations 14
- Concurrency Unlimited
- Business Self-service invoices
How the Midjourney API works
It mirrors the web app and Discord: generate a grid of four, then press buttons on the result. The API hands you every button; send its customId back to run it.
- 01
POST
/mj/submit/imagineSubmit a prompt
Returns a task ID. Put
--ar,--vor--nijistraight into the prompt. $0.0595 per call - 02
GET
/mj/task/{id}/fetchFetch the task
Poll until
SUCCESSto getimageUrland thebuttonslist. Fetching is free - 03
POST
/mj/submit/actionPress a button
Send the
taskIdand a button'scustomId: upscales $0.0298, variations, zoom and pan $0.0595 - 04
POST
/mj/submit/modalConfirm the modal
Vary (Region) and Custom Zoom need a second step with a mask or new prompt. $0.0595 per call
What you can do with the Midjourney API

Imagine
One prompt returns four candidates, with optional image prompts via base64Array. Midjourney is known for light, texture and composition in both photography and illustration.

Niji for anime and illustration
Set
botTypetoNIJI_JOURNEYto switch to Niji for anime, manga and illustrated styles.
Variations
V1-V4 riff on one image. Vary (Strong) moves further, Vary (Subtle) only nudges.

Upscale
U1-U4 pull out a single image, then Subtle or Creative upscales get it ready to ship.

Zoom Out and Pan
Expand the frame 1.5x or 2x, or extend it in one direction, for example turning a portrait into a landscape.

Blend and Describe
Merge 2-5 images into a new one, or send an image and get four prompts that describe it.
From the Midjourney community
These come from top images on Midjourney Explore. Captions summarize each creator's prompt to show Midjourney's range; your results depend on the full prompt, model version and parameters.

@captivate_jblBlack ink line drawing of a couple embracing 
@sleepyvavaA white cat and a black cat swimming among water lilies, after Monet 
@u3813859956VHS screengrab of an 80s anime heroine 
@Dishwasher LasagnaThree stacked passion fruit halves 
@tianyanfnSummer picnic fashion editorial 
@u4438155294Seven sale-themed stickers 
@绥吉Chinese ink-wash 2D character sheet 
@u8877563369A duck in a sweater and sunglasses, digital painting 
@u3591497815An empty intersection late at night, cinematic 
@YERLight blue wide-leg pants on maroon steps, editorial layout 
@yuki0903A simple 2D chibi character in a photo-real scene 
@jedijappstarHand-drawn animal clipart for kids
It can animate, too
Midjourney also has a video model; these two clips come from the Explore community. AnyAIGC currently offers the 14 image operations listed below; check the model catalog for video.
@reality111Red and black halftone figure animation @earnestb"The fish is swimming"
Images come from the Midjourney Explore community and belong to their creators: @Dishwasher Lasagna, @YER, @babypinkbat, @captivate_jbl, @cats666000, @doow, @earnestb, @jedijappstar, @mamechiyo., @mintflavor, @reality111, @sleepyvava, @tianyanfn, @u3591497815, @u3761941744, @u3813859956, @u4438155294, @u6298463395, @u8877563369, @yuki0903, @绥吉. Open Explore
Midjourney API pricing
A flat price per call, whatever the version or number of images. The everyday Imagine call is $0.0595.
- Per callEach successful submission is one charge, no tokens
- Four per gridImagine, Variation and similar calls return four candidates
- Free pollingFetching task status costs nothing
- Unlimited concurrencyOn by default, one balance for 300+ models
| Feature | Model | Endpoint | Price (USD) | Notes |
|---|---|---|---|---|
| Generate | ||||
| Imagine (text or image prompt)Returns a grid of 4 images | mj_imagine | /mj/submit/imagine | $0.0595 / call | Grid of 4 |
| BlendMerge 2-5 images into one | mj_blend | /mj/submit/blend | $0.0595 / call | Grid of 4 |
| DescribeTurn an image into prompts | mj_describe | /mj/submit/describe | $0.0298 / call | — |
| Follow-up actions (/mj/submit/action) | ||||
| UpscaleU1-U4, Subtle and Creative upscales | mj_upscale | /mj/submit/action | $0.0298 / call | — |
| VariationV1-V4 | mj_variation | /mj/submit/action | $0.0595 / call | Grid of 4 |
| Vary (Strong)Bigger changes | mj_high_variation | /mj/submit/action | $0.0595 / call | Grid of 4 |
| Vary (Subtle)Small tweaks | mj_low_variation | /mj/submit/action | $0.0595 / call | Grid of 4 |
| RerollSame prompt, new grid | mj_reroll | /mj/submit/action | $0.0595 / call | Grid of 4 |
| Zoom OutExpand the frame 1.5x or 2x | mj_zoom | /mj/submit/action | $0.0595 / call | Grid of 4 |
| PanExtend up, down, left or right | mj_pan | /mj/submit/action | $0.0595 / call | Grid of 4 |
| Custom ZoomRenders after the modal step (billed as Modal, $0.0595) | mj_custom_zoom | /mj/submit/action | Free | Modal step billed |
| Vary (Region)Renders after the modal step (billed as Modal, $0.0595) | mj_inpaint | /mj/submit/action | Free | Modal step billed |
| Modal and utilities | ||||
| ModalSecond step for Vary (Region) and Custom Zoom, with mask or prompt | mj_modal | /mj/submit/modal | $0.0595 / call | — |
| Upload imagesReturns URLs you can use in prompts | mj_upload | /mj/submit/upload-discord-images | $0.000595 / call | — |
Prices in USD as listed in the model catalog. Billed per successful submission; see the model catalog for live pricing.
Cost examples
Straight addition of the prices above, nothing else added.
-
One grid plus one upscale
Imagine $0.0595 + Upscale $0.0298
$0.0893
The most common flow
-
100 prompts, one upscale each
100 × $0.0893
$8.93
Batch generation
-
Describe 10 images
10 × Describe $0.0298
$0.298
Reverse-engineer prompts
Midjourney API use cases
- E-commerce
Product scenes
Keep the product with an image prompt and generate it in new settings, seasons and styles.
- Marketing
Campaign and social visuals
Generate campaign art in batches, then upscale the winner.
- Games
Characters and concept art
Use Niji for characters and environments, and Variations to iterate fast.
- Design
Mood boards
Describe a reference to get its prompt, or Blend several references into a direction.
- Content
Article art and covers
Reuse one set of style parameters for a consistent look across a series.
- Product
In-app image generation
Put Midjourney inside your own app so users create images in your interface.
Why call Midjourney through AnyAIGC
No Discord account
Midjourney does not currently offer a public API. With an AnyAIGC key you call it over HTTP, without maintaining accounts or channels.
Unlimited concurrency
No concurrency cap on any account, so batch jobs run in parallel without asking for a quota increase.
Pay per call
No monthly plan: Imagine is $0.0595 and upscales are $0.0298, so you pay for what you use.
One key, 300+ models
The same key and balance also run GPT Image, Nano Banana, Seedream and other image models for side-by-side tests.
Get started with the Midjourney API
- Sign up for AnyAIGC. New accounts get 5M free tokens, and top-ups start at $1.
- Create an API key in the console and save it as
ANYAIGC_API_KEY. POST https://anyaigc.ai/mj/submit/imaginewith your prompt, then poll/mj/task/{id}/fetchwith the returned task ID.
import os
import time
import requests
BASE = "https://anyaigc.ai"
HEADERS = {"Authorization": "Bearer " + os.environ["ANYAIGC_API_KEY"]} # Read the key from an environment variable
def submit(path, body):
r = requests.post(BASE + path, headers=HEADERS, timeout=60, json=body).json()
if r.get("code") != 1 or not r.get("result"): # On success code is 1 and result is the task ID; otherwise check description
raise RuntimeError(f"{r.get('code')} {r.get('description')}")
return r["result"]
def wait(task_id):
for _ in range(120): # wait up to 10 minutes
task = requests.get(f"{BASE}/mj/task/{task_id}/fetch", headers=HEADERS, timeout=30).json()
if task.get("status") == "SUCCESS":
return task
if task.get("failReason"): # a failReason means the task failed
raise RuntimeError(task["failReason"])
print(task.get("status"), task.get("progress"))
time.sleep(5)
raise TimeoutError(task_id)
# 1. Submit an Imagine task; result is the task ID
task_id = submit("/mj/submit/imagine", {
"prompt": "a lighthouse on a cliff at dawn, film grain, soft pastel sky --ar 3:2 --v 6.1", # Midjourney parameters go straight into the prompt
"botType": "MID_JOURNEY",
})
task = wait(task_id) # 2. Poll the task; imageUrl is ready once status is SUCCESS
print(task["imageUrl"])
# 3. buttons lists follow-up actions (U1-U4, V1-V4, Zoom, Pan and more)
for b in task["buttons"]:
print(b["label"], b["customId"])
# 4. Upscale image 1: always take customId from buttons, never build it yourself
u1 = next(b for b in task["buttons"] if b["customId"].startswith("MJ::JOB::upsample") and "::1::" in b["customId"])
up = wait(submit("/mj/submit/action", {"taskId": task["id"], "customId": u1["customId"]}))
print(up["imageUrl"])
# Imagine
curl -X POST https://anyaigc.ai/mj/submit/imagine \
-H "Authorization: Bearer $ANYAIGC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "a lighthouse on a cliff at dawn, film grain, soft pastel sky --ar 3:2 --v 6.1", "botType": "MID_JOURNEY"}'
# => {"code": 1, "description": "Submit success", "result": "1730621718151844"}
# Fetch the task
curl https://anyaigc.ai/mj/task/1730621718151844/fetch \
-H "Authorization: Bearer $ANYAIGC_API_KEY"
import base64
import mimetypes
import os
import time
import requests
BASE = "https://anyaigc.ai"
HEADERS = {"Authorization": "Bearer " + os.environ["ANYAIGC_API_KEY"]} # Read the key from an environment variable
def submit(path, body):
r = requests.post(BASE + path, headers=HEADERS, timeout=60, json=body).json()
if r.get("code") != 1 or not r.get("result"): # On success code is 1 and result is the task ID; otherwise check description
raise RuntimeError(f"{r.get('code')} {r.get('description')}")
return r["result"]
def wait(task_id):
for _ in range(120): # wait up to 10 minutes
task = requests.get(f"{BASE}/mj/task/{task_id}/fetch", headers=HEADERS, timeout=30).json()
if task.get("status") == "SUCCESS":
return task
if task.get("failReason"): # a failReason means the task failed
raise RuntimeError(task["failReason"])
print(task.get("status"), task.get("progress"))
time.sleep(5)
raise TimeoutError(task_id)
def data_url(path):
mime = mimetypes.guess_type(path)[0] or "image/png"
with open(path, "rb") as f:
return f"data:{mime};base64," + base64.b64encode(f.read()).decode()
# Blend
blend = wait(submit("/mj/submit/blend", {
"base64Array": [data_url("a.png"), data_url("b.jpg")], # 2-5 images as base64 with the data URL prefix
"dimensions": "SQUARE", # SQUARE / PORTRAIT / LANDSCAPE
}))
print(blend["imageUrl"])
# Describe: send one image, get prompts back
desc = wait(submit("/mj/submit/describe", {"base64": data_url("a.png"), "botType": "MID_JOURNEY"}))
print(desc) # print the whole task to see which field holds the prompts
Authenticate with Authorization: Bearer <API Key>. Submit endpoints return {"code": 1, "result": "task ID"}; the fetch endpoint returns status, progress, imageUrl, buttons and more. See the AnyAIGC Midjourney API docs for every field.
Midjourney API for teams and enterprises
E-commerce, advertising, game and design teams can buy through a standard business process, with support for finance, legal and engineering.
- Invoices
Issue them yourself
Issue an invoice in the console for the amount you actually topped up, whenever you need one.
- Dedicated support
Account and technical contacts
Work with a dedicated support contact and technical engineer for onboarding, migration and troubleshooting.
- WeChat Pay
- Alipay
- USDT
- Credit card
Why teams trust AnyAIGC
Trial credit, top-ups, refunds, data handling and billing, spelled out up front.
5M free tokens to start
New accounts get trial credit, so you can test before you top up.
Top up from $1, refundable
Top up from $1. Unused balance can be refunded with no fee.
Official channels, real models
Requests go to official model channels, never cheaper or reverse-engineered substitutes.
No retention, no training
Unless the law requires it, your prompts and outputs are not persistently stored or used for training. See the privacy policy.
Transparent billing, spend caps
See tokens and cost for every request in the console, and set a quota on each API key.
24/7 support
Contact support any time about integration, billing or incidents.
Midjourney API FAQ
How much does the Midjourney API cost?
AnyAIGC bills Midjourney per call: Imagine, Blend, Variation, Reroll, Zoom, Pan and Modal are $0.0595 each, Upscale and Describe are $0.0298, image upload is $0.000595, and Custom Zoom and Vary (Region) are free (their modal step is billed as Modal). Fetching tasks is free, and live pricing is in the model catalog.
Does Midjourney have an official API?
Midjourney does not currently offer a public API; it runs on its website and Discord. AnyAIGC wraps the Midjourney service in HTTP endpoints, so images come from Midjourney's own models (including Niji) rather than a substitute, and one API key can run Imagine, upscales, variations, zoom and more without a Discord account of your own.
What are the 14 operations, and which endpoints do they use?
The 14 model names map to 14 Midjourney operations, all in the pricing table above. Imagine, Blend and Describe have their own endpoints. Upscale, Variation, Vary (Strong/Subtle), Reroll, Zoom, Pan, Custom Zoom and Vary (Region) all go through /mj/submit/action, selected by the button's customId. Modal is the confirmation step, and Upload sends reference images.
Which Midjourney versions are supported? Can I use Niji?
Pick the version with the --v parameter at the end of the prompt (the API docs use --v 6.1), written the same way as in the official app and passed through to Midjourney. Set botType to NIJI_JOURNEY for the Niji anime model; the default is MID_JOURNEY.
How many images does one call return?
Imagine, Variation, Reroll, Zoom, Pan and similar calls return a grid of four candidates and are billed once. For a single high-resolution image, run Upscale on one of them.
How do I run upscales and variations?
Fetch the task with /mj/task/{id}/fetch. Each entry in buttons has a customId; send the task ID and that customId to /mj/submit/action. Always take customId from the response rather than building it yourself.
Is there a concurrency limit?
No. AnyAIGC sets no concurrency limit on Midjourney for any account, so you can submit tasks in parallel. All requests go to the base URL https://anyaigc.ai, and the same key works for 300+ other models.
Can I get an invoice from AnyAIGC?
Yes. You can issue invoices yourself in the console, for the amount you actually topped up.
Which payment methods are supported?
You can top up with WeChat Pay, Alipay, USDT or a credit card. Your balance is in USD and works across every model on the platform. Invoices can be issued in the console for the amount you topped up.
Is there free trial credit for new users?
Yes. New accounts get 5 million tokens of trial credit, so you can test before deciding to top up. Top-ups start at $1.
Can I get a refund on my balance?
Yes. Unused balance can be refunded with no fee. Contact support to start a refund.
Are these the real models? Is my data safe?
Requests go to official model channels, never cheaper or reverse-engineered substitutes. Unless the law requires it, we do not persistently store your prompts or outputs or use them for training, and the console shows tokens and cost for every request.
Can I use the images commercially?
Usage rights and content policies follow Midjourney's official terms. AnyAIGC only provides API access and places no extra limits on how you use the output.
Start building with Midjourney
5M free tokens to start, Imagine at $0.0595, unlimited concurrency.
