Midjourney Niji API: AI Image Generation

Generate images with Midjourney Niji via the Muapi REST API. Pay per generation — no subscription needed.

Midjourney Niji API Reference

Endpoint

POST https://api.muapi.ai/api/v1/midjourney-niji

Submit a job with your MuApi API key in the x-api-key header, then poll https://api.muapi.ai/api/v1/predictions/{request_id}/result until status is completed.

Parameters

NameTypeRequiredDescription
promptstringYesText description of the image to generate.
image_urlstringNoOptional reference image URL. Influences the style and content of the generation.
aspect_ratiostringNoOutput image aspect ratio.Options: 1:1, 16:9, 9:16, 3:4, 4:3, 21:9Default: "1:1"
stylizeintNoControls how artistic the result is. Range: 0–1000. Lower = more literal, higher = more stylized.Default: 100
chaosintNoControls variation between the 4 images. Range: 0–100. Higher = more diverse.Default: 0
weirdintNoAdds unconventional aesthetics. Range: 0–3000.Default: 0
negative_promptstringNoThings to exclude from the image, e.g. "text, watermark".
seedintNoReproducibility seed. Range: 0–4294967295. Same seed + same prompt ≈ similar result.Default: 0

cURL example

REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/midjourney-niji \
  -H "x-api-key: $MUAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"<prompt>"}' | jq -r .request_id)

curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY"

Python example

import os, time, requests

API = "https://api.muapi.ai/api/v1"
headers = {"x-api-key": os.environ["MUAPI_API_KEY"]}

r = requests.post(f"{API}/midjourney-niji", headers=headers, json={"prompt":"<prompt>"})
request_id = r.json()["request_id"]

while True:
    res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json()
    if res["status"] == "completed":
        print(res["outputs"]); break
    if res["status"] == "failed":
        raise RuntimeError(res.get("error"))
    time.sleep(3)

Full docs and agent/MCP integration: llms.txt. Get an API key at muapi.ai/access-keys.