Getting started
Is there an official Midjourney API?
No. Midjourney does not offer a public API, so every "Midjourney API" you find, ours included, is unofficial. Below is how it works and what to keep in mind before building a product on it.
Updated
How it works
Midjourney generates images for subscribers on its website and through its Discord bot. An unofficial API sends the same commands a person would type, through an account with a subscription, waits for the bot to finish and gives the result to your code as JSON.
With us it looks like this. You add your Discord account with a Midjourney plan in the dashboard. Your code calls, for example, POST /midjourney/v2/imagine with your API key. We run the command on your account, follow its progress, and you get the result from /status or in a webhook: image links, size, progress, errors.
So the account is yours. You pay Midjourney for the subscription, the pictures are made on your account, and you decide the speed mode, Remix and how many accounts to use. We charge for API access: $25 a month per account or $0.04 per request.
About the risk
Midjourney's terms don't allow automated use. That means an account used through any unofficial API can get restricted or banned by Midjourney or Discord. If your product can't live with that risk, you need a model with an official API. If it has to be Midjourney, here is what we do to keep the risk down:
- Every prompt goes through an eligibility check before it reaches Midjourney (toxicity, threats, explicit content and so on). Prompts that fail are not sent to your account at all, which helps it last longer.
- Several accounts on one key instead of one: tasks go to them in turn. We usually advise several Basic or Standard accounts rather than one Pro or Mega.
- Schedules: in the dashboard you can set the hours when each account works, so it doesn't run around the clock.
- Account status:
GET /discord/info?account_hash=…shows whether the account isactive, needs you to accept the Midjourney ToS (tos), isbannedor inerror. Check it and you'll know in time when an account needs attention or replacing.
What is available
Pretty much everything you can do with Midjourney in Discord:
- generation:
imagine, blend, describe; - editing: upscale and upsample, variations, vary, reroll, Remix, inpaint (Vary Region);
- extending: zoom out, pan;
- video: animate;
- account:
info(plan and remaining Fast time),speed(relax, fast, turbo),prefer(Remix).
To try it, get a key. The first 50 requests are free.
Try it on 50 free requests
Register, add a Discord account that has Midjourney, and you get an API key. The first 50 requests are free and you don't need to enter a card. Since 2023 more than 10,000 people have signed up and sent over 8 million requests through the API.
Questions
Does Midjourney have an official API?
No public one. All REST APIs for Midjourney are made by third parties and work through Midjourney accounts.
Is UserAPI.ai connected to Midjourney?
No, we are an independent service and are not affiliated with Midjourney Inc.
Can the account get banned?
Yes, that can happen. Midjourney does not allow automated use, so the risk is there with any unofficial API. We try to reduce it with the prompt check, rotation between accounts and schedules, and the account status shows if something went wrong.
Whose images are they?
They are generated on your Midjourney account under your subscription, just as if you typed the commands in Discord yourself. The Midjourney terms of your plan apply.
What can be done through the API?
Imagine, Upscale, Upsample, Variation, Vary Subtle and Strong, Reroll, Remix, Inpaint (Vary Region), Zoom Out, Pan, Blend, Describe, Animate (video), Seed, plus account methods: info, speed mode, remix.