Midjourney 不出售 API。官方文档里没有端点,没有可以申请的密钥,没有按次价目,也没有可供设计的速率限制。真实存在的东西只有三样:一条 2025 年 7 月 16 日的公告,说公司在调研企业级 API;两个自营界面;以及一条把大多数人所说的「Midjourney API」挡在门外的授权条款。

下面就是这三样的证据,另外附上针对官方已公布规格、完全离线运行的代码。

官方关于 API 说过什么

那条公告就是全部的公开记录。原文是:“We’re starting to investigate opening up an Enterprise API for people to start integrating Midjourney into their companies and services. If you’d like to apply, help us figure out what to provide, or just want follow-up updates please fill out our Enterprise API Application.”

注意用词。动词是调研,公告还反过来请申请者帮忙决定该做什么。没有端点、没有密钥、没有单张价格、没有配额、没有开发者文档。我们在 2026 年 9 月 13 日查看官方更新站时,没有更晚的帖子宣布过上线。

所以「怎么调」这类教程根本写不出来。任何给出 Midjourney REST 请求的教程,要么在讲别的产品,要么在编一个不存在的接口层。

官方只提供两个界面

Midjourney 跑在官网和 Discord 上,两者都是给人用的界面,不是给系统对接的接口。官方 Discord 文档用一句话讲完了整条链路:“After submitting a text prompt, the Midjourney Bot processes your request, creating four unique image options within a minute.”

算力是计量的,而读取计量表的唯一方式是一条聊天命令:“each image generation counts towards the GPU time included with your Midjourney subscription. To monitor your available GPU time (Fast Time Remaining) use the /info command.”

两个界面、一个账号、一个人。条款写着 “Only one user may use the Services per registered account. Each user of the Services may only have one account.” 想靠收集多个账号换吞吐量的方案,本身就不在这个产品允许的形状里。界面这条路怎么走,我们的 Midjourney 上手指南从订阅讲到第一张图,其余文档解读都收在 Midjourney 主题页

决定大多数接入方案的那条条款

写代码之前,先把授权文本读完。它包含三条独立的表述:

You may not use automated tools to access, interact with, or generate Assets through the Services. You may not resell or redistribute the Services or access to the Service. Only one user may use the Services per registered account. Each user of the Services may only have one account.

自动化工具和转售访问权都被点名。宣称提供 Midjourney API 的服务,做的是用自动化工具去打消费级界面,账号风险由持号人承担。

对任何要上生产的东西来说,同页还有两句更要紧。Midjourney「reserves the right to suspend or ban Your access to the Services at any time, and for any reason」,并且对 “quality, stability, uptime or reliability” 不作任何保证。没有可用性承诺可以拿来当产品的底座。这段不是法律意见,请自己读原文。

发送之前可以本地校验的参数

下面这些校验全部在本地跑。值得做的原因很直接:API 没有公布,参数却是公布的。

官方公布的三条格式规则

参数页写明了三条格式规则,实际写提示词翻车也基本翻在这三条上:

  • 参数放在提示词末尾。
  • 提示词与第一个 -- 之间要有空格。
  • 参数内部不要用标点。

同一页还列出了参数全集:--ar--chaos--no--quality--seed--stylize--sref--tile--version--weird--repeat--draft,以及控制算力档位的 --fast--relax--turbo。其中一条值得写进你自己的工具里:--oref 被标注为在 V8.X 中已被 Edit Model 取代,2026 年写的校验脚本不该再教它。

画幅比规则

默认是 1:1。--ar 不能带小数,所以 1.39:1 要写成 139:100;极端宽高的比例被标为实验性质。上限定在版本文档里:V8.1 与 V8.2 的最大画幅比是 14:1,HD 是 4:1。

#!/usr/bin/env bash
# Assemble and check a Midjourney prompt against the rules the official
# parameter and aspect-ratio pages state. Runs offline.
set -uo pipefail

prompt="a weathered fishing boat in a harbour at dawn"
params=(--ar 16:9 --v 8.2 --stylize 250 --chaos 10)
ceiling=14   # Version page: max aspect ratio 14:1 for V8.1 and V8.2

if [[ "$prompt" == *"--"* ]]; then
  echo "rejected: the prompt itself contains --, so parameters cannot come last" >&2
  exit 1
fi
if (( ${#params[@]} % 2 != 0 )); then
  echo "rejected: every parameter needs a value" >&2
  exit 1
fi

for ((i = 0; i < ${#params[@]}; i += 2)); do
  flag="${params[i]}"
  value="${params[i + 1]}"
  if [[ "$value" == *","* || "$value" == *";"* ]]; then
    echo "rejected: $flag carries a separator; the docs ask for no punctuation" >&2
    exit 1
  fi
  case "$flag" in
    --ar)
      if [[ "$value" == *.* ]]; then
        echo "rejected: --ar cannot contain decimals; write 139:100, not 1.39:1" >&2
        exit 1
      fi
      width="${value%%:*}"
      height="${value##*:}"
      if [[ "$width" == "$value" || ! "$width" =~ ^[0-9]+$ || ! "$height" =~ ^[0-9]+$ ]]; then
        echo "rejected: --ar needs two positive integers, like 16:9" >&2
        exit 1
      fi
      if (( width > height * ceiling )); then
        echo "rejected: --ar is wider than the documented ${ceiling}:1 ceiling" >&2
        exit 1
      fi
      ;;
    --v)
      if [[ "$value" != "7" && "$value" != "8.1" && "$value" != "8.2" ]]; then
        echo "rejected: --v $value is not a version the version page lists" >&2
        exit 1
      fi
      ;;
    --stylize|--s|--chaos|--c)
      if [[ ! "$value" =~ ^[0-9]+$ ]]; then
        echo "rejected: $flag needs a whole number; the docs publish no range for it" >&2
        exit 1
      fi
      ;;
  esac
done

printf '%s %s\n' "$prompt" "${params[*]}"

同一套规则的 Python 校验脚本

Shell 版本适合校验单条提示词,这一段适合进测试。模板悄悄漂移这种毛病,通常要等一整批出图全废才会被发现。

有一点要注意,这个脚本故意不查什么。参数页没有公布 --stylize--chaos 的数值范围,所以代码只拒绝读不成整数的值,不去执行一条它从未见过的范围。凭感觉补一个边界,正是假规格扩散的方式。

"""Check a Midjourney prompt string against the published rules. Offline."""

import re

ASPECT_FLAGS = {"--ar", "--aspect"}


def check(raw: str, ceiling: int = 14) -> str:
    """Return the prompt unchanged if it passes, raise ValueError otherwise."""
    if " --" not in raw:
        raise ValueError("a space must separate the prompt from the first --")
    _prompt, _, tail = raw.partition(" --")
    tokens = ("--" + tail).split()
    if len(tokens) % 2:
        raise ValueError("every parameter needs a value")
    for flag, value in zip(tokens[::2], tokens[1::2]):
        if any(character in value for character in ",;"):
            raise ValueError(f"{flag}: no punctuation inside a parameter")
        if flag in ASPECT_FLAGS:
            if "." in value:
                raise ValueError("--ar cannot contain decimals: write 139:100")
            ratio = re.fullmatch(r"(\d+):(\d+)", value)
            if ratio is None:
                raise ValueError("--ar takes two integers, like 16:9")
            width, height = (int(part) for part in ratio.groups())
            if width > height * ceiling:
                raise ValueError(f"--ar is wider than the {ceiling}:1 ceiling")
        elif flag in {"--v", "--version"} and value not in {"7", "8.1", "8.2"}:
            raise ValueError(f"--v {value} is not a version the version page lists")
    return raw


print(check("a weathered fishing boat in a harbour at dawn --ar 16:9 --v 8.2 --stylize 250"))

for bad in (
    "a harbour --ar 1.39:1",
    "a harbour --ar 20:1",
    "a harbour --v 9",
    "a harbour --ar 16:9,",
    "a harbour--ar 16:9",
):
    try:
        check(bad)
    except ValueError as error:
        print("rejected:", error)

官方像素表,写成断言

输出尺寸是官方唯一按画幅比逐个公布的规格,也就最值得钉进代码。下表是 V8.2 的已公布数字,官方还加了脚注:某些画幅比下 HD 的确切像素「may vary slightly」。

画幅比V8.2 标准图V8.2 升采样 / HD
1:11024 × 10242048 × 2048
4:31232 × 9282464 × 1856
2:3896 × 13441792 × 2688
16:91456 × 8162912 × 1632
"""The pixel table from Midjourney's upscaler page, checked by assertion."""

# As published for V8.2, one row per aspect ratio. The page adds that exact HD
# pixels "may vary slightly" in some aspect ratios.
SAMPLES = {
    "1:1": {"sd": (1024, 1024), "hd": (2048, 2048)},
    "4:3": {"sd": (1232, 928), "hd": (2464, 1856)},
    "2:3": {"sd": (896, 1344), "hd": (1792, 2688)},
    "16:9": {"sd": (1456, 816), "hd": (2912, 1632)},
}

# Version page: HD costs 1.3 minutes of GPU time against 0.8 for a standard job.
GPU_MINUTES = {"sd": 0.8, "hd": 1.3}

for ratio, row in SAMPLES.items():
    width_sd, height_sd = row["sd"]
    width_hd, height_hd = row["hd"]
    assert width_hd == width_sd * 2, ratio
    assert height_hd == height_sd * 2, ratio
    assert width_sd % 8 == 0 and height_sd % 8 == 0, ratio

assert SAMPLES["1:1"]["sd"] == (1024, 1024)     # the documented default square
assert SAMPLES["1:1"]["hd"] == (2048, 2048)     # HD cannot be upscaled further
assert round(GPU_MINUTES["hd"] / GPU_MINUTES["sd"], 3) == 1.625  # +62.5%

# What one 16:9 HD render costs in plan allowance, in minutes:
print(f"16:9 HD is {SAMPLES['16:9']['hd'][0]}x{SAMPLES['16:9']['hd'][1]}px "
      f"for {GPU_MINUTES['hd']} GPU minutes")
Midjourney 官方编辑模型公告配图,逐行展示源图、箭头与其后发布的编辑结果
Midjourney

这张表能推出两件事。1:1 的标准图短边就已经是 1024 像素,这也是当前版本里 U 按钮不再用于升采样的原因。HD 一张要 1.3 GPU 分钟,标准图是 0.8,同样一批任务用 HD 大约多花 62% 的额度;官方另有一句提醒:对标准图做升采样,「can cost twice as many GPU minutes as generating your initial images」。

第三方网关实际在做什么

搜索 Midjourney API,会搜到一批在卖这项服务的站点。它们卖的是对某个账号的自动化访问,包装成了服务。有些会挂出自己的单张报价,那是该站自身的报价,不是官方的;而且这些数字会随时变动,因为底层的成本来源是一份订阅。

三个问题能把可接受与很脆弱分开。这个站点在自己的页面上承认没有官方 API 吗?一旦平台执行条款,被封的账号握在谁手里?产出授权还落得到你头上吗——所有权绑定在具名账号的订阅上,年营收超过 100 万美元时还必须用 Pro 或 Mega。

如果你真正需要的是一个可编程的出图接口,就选公布了接口的产品。自建的 Stable Diffusion 从根本上绕开界面问题,GPT Image 2.5 则是端点与价格都公开的一手图像模型。

官方至今未公布的部分

这张清单很短,而其中每一条在网上都会被人用猜测补上。

  • 端点、请求与响应结构,以及任何 base URL。
  • 密钥:怎么申请、长什么样、怎么轮换。
  • 按次定价、额度包,以及 API 用量是否消耗 GPU 分钟。
  • 速率限制、并发上限与排队行为。
  • 可用性、延迟与支持承诺。
  • 企业级 API 若上线,是否覆盖企业规模以下的用户。
  • 模型训练数据,官方文档同样没有说明。

常见问题

Midjourney 有官方 API 吗? 没有公开 API。官方唯一相关的表述是 2025 年 7 月 16 日那条「正在调研企业级 API」的公告,此后没有任何进展公布。

我能用程序调 Midjourney 吗? 条款禁止使用自动化工具访问、交互或生成产出,也禁止转售访问权。围绕这条线做的东西,风险由账号承担。

那些第三方「Midjourney API」服务可信吗? 它们不是官方的,官方也没有发布任何授权它们的内容。

今天有什么能真正落地的开发工作? 就是上面的代码:在本地校验参数,把官方像素与算力数字收进一张带断言的表,让 CI 拒掉违反官方格式规则的提示词。

Midjourney API 这个问题目前有一个稳定的答案,而且是否定的:把工具建立在已经公布的规格上,把条款原文放在手边。