Skip to main content
AnyAIGC

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
  • Midjourney community image 1
  • Midjourney community image 2
  • Midjourney community image 3
  • Midjourney community image 4
  • Midjourney community image 5
  • Midjourney community image 6
  • Midjourney community image 7
  • Midjourney community image 8
  • Midjourney community image 9
  • Midjourney community image 10
  • Midjourney community image 11
  • Midjourney community image 12
  • Midjourney community image 13
  • Midjourney community image 14
  • Midjourney community image 15

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.

  1. 01

    POST/mj/submit/imagine

    Submit a prompt

    Returns a task ID. Put --ar, --v or --niji straight into the prompt. $0.0595 per call

  2. 02

    GET/mj/task/{id}/fetch

    Fetch the task

    Poll until SUCCESS to get imageUrl and the buttons list. Fetching is free

  3. 03

    POST/mj/submit/action

    Press a button

    Send the taskId and a button's customId: upscales $0.0298, variations, zoom and pan $0.0595

  4. 04

    POST/mj/submit/modal

    Confirm 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

    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

    Niji for anime and illustration

    Set botType to NIJI_JOURNEY to switch to Niji for anime, manga and illustrated styles.

  • Variations

    Variations

    V1-V4 riff on one image. Vary (Strong) moves further, Vary (Subtle) only nudges.

  • Upscale

    Upscale

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

  • Zoom Out and Pan

    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

    Blend and Describe

    Merge 2-5 images into a new one, or send an image and get four prompts that describe it.

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
Midjourney API pricing (USD)
FeatureModelEndpointPrice (USD)Notes
Generate
Imagine (text or image prompt)Returns a grid of 4 imagesmj_imagine/mj/submit/imagine$0.0595 / callGrid of 4
BlendMerge 2-5 images into onemj_blend/mj/submit/blend$0.0595 / callGrid of 4
DescribeTurn an image into promptsmj_describe/mj/submit/describe$0.0298 / call—
Follow-up actions (/mj/submit/action)
UpscaleU1-U4, Subtle and Creative upscalesmj_upscale/mj/submit/action$0.0298 / call—
VariationV1-V4mj_variation/mj/submit/action$0.0595 / callGrid of 4
Vary (Strong)Bigger changesmj_high_variation/mj/submit/action$0.0595 / callGrid of 4
Vary (Subtle)Small tweaksmj_low_variation/mj/submit/action$0.0595 / callGrid of 4
RerollSame prompt, new gridmj_reroll/mj/submit/action$0.0595 / callGrid of 4
Zoom OutExpand the frame 1.5x or 2xmj_zoom/mj/submit/action$0.0595 / callGrid of 4
PanExtend up, down, left or rightmj_pan/mj/submit/action$0.0595 / callGrid of 4
Custom ZoomRenders after the modal step (billed as Modal, $0.0595)mj_custom_zoom/mj/submit/actionFreeModal step billed
Vary (Region)Renders after the modal step (billed as Modal, $0.0595)mj_inpaint/mj/submit/actionFreeModal step billed
Modal and utilities
ModalSecond step for Vary (Region) and Custom Zoom, with mask or promptmj_modal/mj/submit/modal$0.0595 / call—
Upload imagesReturns URLs you can use in promptsmj_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

  1. Sign up for AnyAIGC. New accounts get 5M free tokens, and top-ups start at $1.
  2. Create an API key in the console and save it as ANYAIGC_API_KEY.
  3. POST https://anyaigc.ai/mj/submit/imagine with your prompt, then poll /mj/task/{id}/fetch with the returned task ID.
Python · imagine, poll, upscale
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"])
cURL · submit and fetch
# 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"
Python · blend and describe
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.

Payment methods
  • 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.