How to get started with Midjourney API

GoAPI
25 Jan 202404:26

TLDRThis tutorial from go API introduces enthusiasts to the unofficial Mid Journey API, designed to be integrated into existing workflows. Users can visit goapi.ai, explore the API's endpoints and pricing, and sign up via GitHub for free credits. The guide demonstrates using Postman to make POST requests with the API key for the 'Imagine' endpoint, submit a task, and then fetch the results to view generated images. The tutorial encourages liking, subscribing, and sharing for more content.

Takeaways

  • 😀 The tutorial is for a non-official Midjourney API created by enthusiasts to assist users with their workflows.
  • 🔍 To begin, visit goapi.ai, which offers the Midjourney API alongside other AI APIs like GPT and stable diffusion.
  • 📚 Click on 'documentation' to access the latest version of the Midjourney API and review the available endpoints and processing modes.
  • 💰 Check the 'pricing plan' to understand the cost of each 'Imagine' call, which varies based on the processing mode used.
  • 👥 Sign up on the dashboard using GitHub to receive free credits to try out the service, and benefit from a referral program for additional credits.
  • 🔑 After signing up, securely store your API key, which is essential for making requests.
  • 🛠️ Use Postman, an API development platform, to create new HTTP requests to interact with the API.
  • 📝 In Postman, set the request type to 'POST', paste the 'Imagine' endpoint, and include the API key in the headers.
  • 📜 Copy and paste the example request code into Postman's body, modify it by removing the webhook endpoint and aspect ratio, then input your prompt.
  • 🚀 After sending the 'Imagine' request, note the task ID returned, which is necessary for the next step.
  • 🔄 Create a new 'POST' request for the 'Fetch' endpoint, using the example request code and replacing the task ID with the one obtained previously.
  • 🖼️ Upon successful fetch, you will receive URLs to access the generated images, completing the process of using the Midjourney API.

Q & A

  • What is the purpose of the 'go API' tutorial?

    -The purpose of the 'go API' tutorial is to show users how to get started with the Mid Journey API, which is a third-party API created by enthusiasts to help incorporate Mid Journey functionality into existing workflows.

  • Is the Mid Journey API provided by 'go API' an official API from Mid Journey?

    -No, the Mid Journey API provided by 'go API' is not an official API from Mid Journey. It is created by a team of enthusiasts who are passionate about Mid Journey.

  • What types of APIs does 'go API' offer besides Mid Journey API?

    -'go API' offers other APIs such as GPT, stable diffusion, and more, in addition to the Mid Journey API.

  • How can one access the documentation for the Mid Journey API?

    -To access the documentation for the Mid Journey API, one should visit the 'go API' website, click on the 'mid-journey' button, and then click on 'documentation'.

  • What are the different processing modes available for the Mid Journey API?

    -The Mid Journey API offers different processing modes such as 'relax', 'fast', and 'turbo', which correspond to their Mid Journey equivalents.

  • How can users sign up for the 'go API' dashboard?

    -Users can sign up for the 'go API' dashboard using their GitHub account, which also provides them with free credits to try out the service.

  • What is the benefit of the referral program mentioned in the tutorial?

    -The referral program allows users to share the service with friends. Both the referrer and the referred receive additional free credits when the service is used.

  • How should the API key obtained from the 'go API' dashboard be used?

    -The API key should be stored safely and used in the header of the Postman requests as 'x-api-key' when making API calls to the 'go API'.

  • What is the process of making a request to the 'Imagine' endpoint using Postman?

    -After setting the request type to POST and pasting the 'Imagine' endpoint, users should add the API key in the header, paste the example request code in the body, remove unnecessary parameters like 'web hook endpoint' and 'aspect ratio', and then input their prompt before sending the request.

  • How can users retrieve their images after a successful 'Imagine' request?

    -After a successful 'Imagine' request, users will receive a task ID. They can then make a POST request to the 'Fetch' endpoint, using the task ID in the body of the request. Upon successful fetch, they will receive URLs to access the images.

  • What should users do if they want to see the images generated by the Mid Journey API?

    -Users should copy one of the provided URLs after a successful fetch, paste it into a new browser tab, and they will be able to view the generated images.

Outlines

00:00

🚀 Introduction to Go API and Mid Journey API Tutorial

The script introduces Go API, a group of enthusiasts passionate about Mid Journey, who have created an unofficial API to help others. The tutorial aims to guide users on how to start using the Mid Journey API, which includes various endpoints and processing modes like relax, fast, and turbo. The video will focus on the 'Imagine' endpoint for a successful fetch task. The script also mentions pricing plans and a referral program for additional credits.

💻 Getting Started with Mid Journey API

The tutorial continues with instructions on how to get started with the Mid Journey API. Users are directed to the Go API website to sign up and obtain free credits via GitHub. It emphasizes the importance of storing the API key safely. The script then guides the user to use Postman, an API platform for developers, to set up a new HTTP request, change it to POST, and input the API key in the header. It provides a step-by-step guide on how to make a POST request using the 'Imagine' endpoint and process the task with a sample prompt.

🔑 API Key and Postman Setup

This section of the script details the process of obtaining and using the API key from the Go API dashboard. It explains how to copy the key and use it in Postman to make a POST request. The user is instructed to change the request type to POST in Postman, paste the endpoint, input the API key in the header, and then proceed to use the example request from the documentation, modifying it as necessary to include their own prompt.

📈 Task Submission and Fetching Results

The script explains how to submit a task using the 'Imagine' endpoint and then fetch the results. After sending the initial POST request with the prompt, the user receives a task ID. The tutorial then guides the user to create a new POST request for the fetch endpoint, using the task ID obtained from the previous step. The user is shown how to copy the necessary code, paste it into Postman, replace the task ID, and send the request to retrieve the image URLs.

🖼️ Viewing the Generated Images

The final part of the script instructs the user on how to view the generated images after the fetch request is successful. It mentions that there are two URLs provided for the images, which are the same, and the user can use either one. The user is advised to copy the URL, paste it into a new tab, and view the resulting images. The tutorial concludes with a thank you message, encouraging viewers to like and subscribe for more API-related content.

Mindmap

Keywords

💡Midjourney API

The term 'Midjourney API' refers to the application programming interface provided by the tutorial's creators, which is designed to mimic the functionalities of the 'Midjourney' platform. In the context of the video, it's a tool that enthusiasts have developed to help integrate the capabilities of Midjourney into other workflows. The script mentions that this API is not an official one but is built by a team passionate about Midjourney to fill a need in the community.

💡API

API stands for Application Programming Interface, which is a set of rules and protocols for building software applications. In the video, the API is the method through which users can interact programmatically with the Midjourney-like functionalities provided by the tutorial's creators. The script discusses how to get started with this API, including accessing documentation and using it within a development environment like Postman.

💡Endpoints

In the context of APIs, 'endpoints' are the individual URLs representing the different functionalities that can be accessed. The script lists endpoints as part of the documentation for the Midjourney API, indicating that these are the specific URLs that developers can use to perform actions such as image generation.

💡Processing Modes

The 'processing modes' mentioned in the script refer to the different options available for how the API processes requests, such as 'relax', 'fast', and 'turbo'. These modes likely correspond to varying levels of speed and resource usage, affecting the performance of the API when generating images or performing other tasks.

💡Imagine Endpoint

The 'Imagine endpoint' is a specific part of the API that is used to generate images based on prompts provided by the user. The script uses this endpoint as an example to demonstrate how to make a request to the API and receive a response, which includes a task ID for tracking the image generation process.

💡Pricing Plan

The 'pricing plan' discussed in the script outlines the costs associated with using the Midjourney API. Each 'Imagine' call has a variable cost depending on the processing mode selected, and the script suggests that the pricing is competitive, encouraging users to consider the API for their projects.

💡GitHub

GitHub is a platform for version control and collaboration that is widely used by developers. In the script, it is mentioned as a method for signing up for the API service's dashboard, which also provides free credits for users to try out the service.

💡Postman

Postman is an API platform for developers to test, document, and develop APIs. The script instructs viewers on how to use Postman to interact with the Midjourney API by setting up requests, including the necessary headers and body content, to perform tasks such as image generation.

💡API Key

An 'API key' is a unique code used to authenticate requests to an API. In the context of the video, users are instructed to obtain an API key from the service's dashboard and use it in the headers of their Postman requests to ensure that they are authorized to use the API.

💡Fetch Endpoint

The 'Fetch endpoint' is another part of the API that is used to retrieve the results of a previously submitted task, such as the images generated by the 'Imagine' endpoint. The script demonstrates how to make a request to this endpoint using the task ID obtained from the 'Imagine' request.

💡Task ID

A 'Task ID' is a unique identifier for a specific task or operation performed using the API. In the script, the Task ID is returned by the 'Imagine' endpoint and is then used as a parameter in the 'Fetch' endpoint to retrieve the results of the image generation process.

Highlights

Introduction to a tutorial on getting started with the unofficial Midjourney API by go API.

The creators are enthusiasts passionate about Midjourney and aim to help others with the API.

The tutorial covers how to incorporate the API into existing workflows.

Instructions to visit goapi.ai for accessing the Midjourney API and other AI APIs.

Explanation of different processing modes: relax, fast, and turbo.

A walkthrough of the documentation for the latest version of the Midjourney API.

Demonstration of using the 'Imagine' endpoint for a successful fetch on the task submitted.

Pricing plan details for the Midjourney API and its cost-effectiveness.

How to sign up for the dashboard using GitHub and earn free credits.

Information about the referral program and earning additional free credits.

The importance of safely storing the API key obtained from the dashboard.

Using Postman as an API platform for developers to interact with the API.

Steps to create a new HTTP request in Postman and setting it to POST.

Instructions on adding the API key in the header for authentication.

Example request codes provided for Python, Node, and Curl.

How to send a prompt to the 'Imagine' endpoint and receive a task ID.

Creating a new POST request for the 'Fetch' endpoint to retrieve images.

How to replace the task ID in the 'Fetch' request with the one obtained earlier.

The successful retrieval of image URLs and viewing the generated images.

Final steps to get started with the Midjourney API using go API in minutes.

Encouragement to like, subscribe, and follow for more API-related content.