DEV Community

Cover image for How to get started with Midjourney API with GoAPI
GoAPI
GoAPI

Posted on

How to get started with Midjourney API with GoAPI

Hi developers! We are very excited to make this introductory tutorial to show you how you can get started with Midjourney API developed by the GoAPI team!​

Full disclosure, this is not an official API by Midjourney. We are a team of computer graphics experts and backend engineers. With the advent of generative AI, we fell in love with Midjourney, and thought this neat API service can help a lot of developers to be incorporated into their existing workflow.​

To get started, go to GoAPI’s Midjourney API, hover on “Docs” and click on “Midjourney API”, then you would be able to see the list of endpoints that we currently offer (and we are constantly maintaining and adding more endpoints).

Image description

You can also see the different processing modes that we offer: “mixed mode” from GoAPI means that your task will either be processed under Midjourney’s relaxed or fast mode; and the “fast mode” from GoAPI means that your task will only be processed under Midjourney’s fast mode.

Image description

If you go to the Pricing & Payment page, you can see the pricing info we have for both Midjourney and Stable Diffusion API.

Under the PPU (Pay Per Use) option for Midjourney, each API call in the mixed mode will cost 7 credits. Given that each credit costs ~$0.0014USD, therefore each mixed mode API call will work out to be about 1¢ USD; and each fast mode API call is about 2¢ USD.

Thus, if you do the math on how many pictures you use per month, you will find that our pricing is very competitive for your needs.​

We also offer the option of trying our PPU option service for only $1(for which you get 200 credits) — it is a great way to test the API and see if that would fit into your existing workflow.

If you have made the one-dollar-trial payment, you are going to receive an automatic email with your API key and redeem code corresponding to the payment amount you have made.

Image description

Then, we are going to use Postman to test out the Midjourney API service with the following steps:

  • Download/open up Postman, create a new HTTP request, change the request to POST.

  • Under Headers, type “X-API-KEY” under the Key, and your API key under Value.

  • Under Body, click “raw”. and copy the python code from our docs into the body.

  • Press the Send button

  • Next, create a new HTTP request, change the request to POST. Find the Fetch endpoint in our documentation, copy the endpoint url and do the following as shown in the screenshot below. Press Send, and you would get the URLs to your picture in the Response.

When you send the fetch request, the result might say “pending” or “processing” instead of “finished” which means that you would have to wait for a bit and then re-send the fetch post request. If you don’t want to wait, you could also use the webhook function, which will send you a message automatically after the task in completed. We will cover how to use the webhook in another tutorial.

Finally, copy the returned URL into your web browser to retrieve your picture!

And that is how your get started with Midjourney API in a few minutes with GoAPI. Thank you for getting this far through the tutorial, and feel free to share our service with anyone who might find it useful — we are immensely grateful! :D

Image description

Also, this is a video showing the steps taken in this blog post, which is very neat if you want follow along!

Top comments (0)