> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aireiter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Midjourney V8.2 이미지 생성

> - 비동기 처리 모드, 후속 조회를 위한 작업 ID 반환
- 요청 1회당 4장의 개별 이미지 생성, 장수가 아닌 요청 횟수당 과금
- 텍스트-투-이미지, 참조 이미지(최대 4장), 스타일 참조, 이미지 편집 지원
- 화면 비율, 화질, 속도를 파라미터로 선택 가능하며, 프롬프트에 Midjourney 파라미터를 직접 입력할 필요 없음


export const apiKeyUrl = 'https://aireiter.com/keys';

## Authorizations

<ParamField header="Authorization" type="string" required>
  모든 API는 Bearer Token을 통한 인증이 필요합니다

  API Key 받기:

  <a href={apiKeyUrl} target="_blank">API Key 관리 페이지</a>에 방문하여 API Key를 발급받으세요

  사용 시 요청 헤더에 추가:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="model" type="string" required>
  모델 이름, `"mj_v8_2"`로 고정
</ParamField>

<ParamField body="params" type="object" required>
  모델 파라미터 객체

  <Expandable title="params 객체 속성">
    <ParamField body="prompt" type="string" required>
      이미지의 텍스트 설명, 원하는 장면을 자연어로 작성

      * 버전, 화면비, 화질, 속도 등의 Midjourney 파라미터는 아래 필드에 의해 자동으로 추가되므로 직접 작성할 필요가 없습니다
      * 프롬프트에 직접 작성한 `--` 파라미터(예: `--ar`, `--v`, `--fast`)는 무시되며, 첫 번째 `--`부터의 내용은 적용되지 않습니다
      * 이미지 편집(`use_edit`) 사용 시, 수정 명령어를 직접 작성할 수 있습니다. 예: "Render this logo as a hand drawn pencil sketch"
    </ParamField>

    <ParamField body="image_url" type="string[]">
      참조 이미지(Image Prompt)의 URL 목록으로, 결과물의 콘텐츠, 구도 및 색감에 영향을 줍니다

      * 최대 4장까지 가능하며, 전달된 순서대로 사용됩니다
      * 전달하지 않을 경우 텍스트 투 이미지(Text-to-Image)로 동작합니다
      * 다음 두 가지 형식을 지원합니다:
        1. 공개적으로 접근 가능한 URL(로그인, 쿠키 또는 임시 권한 요구 불가)
        2. Base64 인코딩 형식
           * 완전한 Data URI 형식을 사용해야 합니다: `data:image/{형식};base64,{base64데이터}`
           * 지원되는 이미지 형식: jpeg, png, webp
           * 예시: `data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABg...`
           * ⚠️ 주의: 반드시 `data:image/jpeg;base64,` 접두사 부분을 포함해야 하며, base64 이미지 크기는 10MB를 초과할 수 없습니다
    </ParamField>

    <ParamField body="image_weight" type="number" default="1">
      참조 이미지 가중치(`--iw`에 해당), 결과물이 참조 이미지에 얼마나 가까운지를 결정

      * 값 범위 0-3, 기본값 1, 값이 클수록 참조 이미지와 유사해집니다
      * `image_url`을 전달한 경우에만 적용됩니다
    </ParamField>

    <ParamField body="aspect_ratio" type="string" default="1:1">
      이미지 가로세로 비율(`--ar`에 해당)

      지원되는 가로세로 비율:

      * `1:1` - 정사각형(기본값)
      * `16:9` - 가로 와이드스크린
      * `9:16` - 세로 화면
      * `4:3` - 가로 4:3
      * `3:4` - 세로 3:4
      * `3:2` - 가로 3:2
      * `2:3` - 세로 2:3
    </ParamField>

    <ParamField body="quality" type="string" default="sd">
      화질 단계

      지원되는 값:

      * `sd` - 표준 화질(기본값), 1:1 기준 장당 1024×1024
      * `hd` - 네이티브 고화질, 1:1 기준 장당 2048×2048

      기타 화면비는 비율에 따라 환산되며, 실제 크기는 반환된 이미지를 기준으로 합니다.
    </ParamField>

    <ParamField body="speed" type="string" default="fast">
      생성 속도(`--fast` / `--relax`에 해당)

      지원되는 값:

      * `fast` - 고속 모드(기본값)
      * `relax` - 저속 모드, 대기 시간이 더 길어집니다

      저속 모드는 별도의 채널에서 처리되며, 실제 테스트 결과 고속 모드보다 2배 이상 느립니다.
    </ParamField>

    <ParamField body="use_style_ref" type="boolean" default="false">
      스타일 참조 활성화 여부(`--sref`에 해당)

      다른 이미지의 화풍, 색감 및 질감을 차용하며, 인물이나 사물을 그대로 복사하지 않습니다. `true`로 설정할 경우 반드시 `style_image_url`을 전달해야 합니다.
    </ParamField>

    <ParamField body="style_image_url" type="string">
      스타일 참조 이미지, 1장

      * `use_style_ref`가 `true`일 때만 적용되며, 이때는 필수 항목입니다
      * 형식 요구 사항은 `image_url`과 동일합니다
    </ParamField>

    <ParamField body="style_weight" type="number" default="100">
      스타일 강도(`--sw`에 해당)

      * 값 범위 0-1000, 기본값 100
      * `use_style_ref`가 `true`일 때만 적용됩니다
    </ParamField>

    <ParamField body="use_edit" type="boolean" default="false">
      이미지 편집 활성화 여부(`--edit`에 해당)

      `prompt`를 수정 명령어로 사용하여 기존 이미지를 편집합니다. `true`로 설정할 경우 반드시 `edit_image_url`을 전달해야 합니다. `image_url`, 스타일 참조와 동시에 사용할 수 있습니다.
    </ParamField>

    <ParamField body="edit_image_url" type="string">
      편집할 대상 이미지, 1장

      * `use_edit`가 `true`일 때만 적용되며, 이때는 필수 항목입니다
      * 형식 요구 사항은 `image_url`과 동일합니다
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="out_task_id" type="string" required>
  요청자 작업 ID

  사용자 지정 작업 식별자, 필수 항목입니다. 영문자, 숫자, `_`, `-`만 지원되며, 길이는 1-64자입니다
</ParamField>

## Response

<ResponseField name="out_task_id" type="string">
  요청자 작업 ID로, 결과 조회에 사용할 수 있습니다
</ResponseField>

<ResponseField name="status" type="string">
  초기 상태, `"pending"`으로 고정
</ResponseField>

<ResponseField name="created_at" type="string">
  생성 시간(ISO 형식)
</ResponseField>

작업 완료 후 조회 인터페이스를 통해 결과를 가져옵니다. `data.output`에 4장의 이미지가 포함되어 있으며, 기존 4분할 그리드의 좌측 상단, 우측 상단, 좌측 하단, 우측 하단 순서로 정렬됩니다. 생성에는 일반적으로 몇 분 정도 소요되므로 대기 중 중복 제출하지 마세요.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://aireiter.com/api/openapi/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "mj_v8_2",
      "params": {
        "prompt": "A blue robot watering tulips in a sunny garden, storybook illustration",
        "image_url": [
          "https://example.com/product.png",
          "https://example.com/style.png"
        ],
        "aspect_ratio": "16:9",
        "quality": "hd",
        "speed": "fast"
      },
      "out_task_id": "my_task_123456"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://aireiter.com/api/openapi/submit"

  payload = {
      "model": "mj_v8_2",
      "params": {
          "prompt": "A blue robot watering tulips in a sunny garden, storybook illustration",
          "image_url": [
              "https://example.com/product.png",
              "https://example.com/style.png"
          ],
          "aspect_ratio": "16:9",
          "quality": "hd",
          "speed": "fast"
      },
      "out_task_id": "my_task_123456"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://aireiter.com/api/openapi/submit";

  const payload = {
    model: "mj_v8_2",
    params: {
      prompt: "A blue robot watering tulips in a sunny garden, storybook illustration",
      image_url: [
        "https://example.com/product.png",
        "https://example.com/style.png"
      ],
      aspect_ratio: "16:9",
      quality: "hd",
      speed: "fast"
    },
    out_task_id: "my_task_123456"
  };

  const headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io"
      "net/http"
  )

  func main() {
      url := "https://aireiter.com/api/openapi/submit"

      payload := map[string]interface{}{
          "model": "mj_v8_2",
          "params": map[string]interface{}{
              "prompt":       "A blue robot watering tulips in a sunny garden, storybook illustration",
              "image_url":    []string{"https://example.com/product.png", "https://example.com/style.png"},
              "aspect_ratio": "16:9",
              "quality":   "hd",
              "speed":   "fast",
          },
          "out_task_id": "my_task_123456",
      }

      jsonData, _ := json.Marshal(payload)

      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer <token>")
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;

  public class Main {
      public static void main(String[] args) throws Exception {
          String url = "https://aireiter.com/api/openapi/submit";

          String payload = """
          {
            "model": "mj_v8_2",
            "params": {
              "prompt": "A blue robot watering tulips in a sunny garden, storybook illustration",
              "image_url": [
                "https://example.com/product.png",
                "https://example.com/style.png"
              ],
              "aspect_ratio": "16:9",
              "quality": "hd",
              "speed": "fast"
            },
            "out_task_id": "my_task_123456"
          }
          """;

          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create(url))
              .header("Authorization", "Bearer <token>")
              .header("Content-Type", "application/json")
              .POST(HttpRequest.BodyPublishers.ofString(payload))
              .build();

          HttpResponse<String> response = client.send(request,
              HttpResponse.BodyHandlers.ofString());

          System.out.println(response.body());
      }
  }
  ```

  ```php PHP theme={null}
  <?php

  $url = "https://aireiter.com/api/openapi/submit";

  $payload = [
      "model" => "mj_v8_2",
      "params" => [
          "prompt" => "A blue robot watering tulips in a sunny garden, storybook illustration",
          "image_url" => [
              "https://example.com/product.png",
              "https://example.com/style.png"
          ],
          "aspect_ratio" => "16:9",
          "quality" => "hd",
          "speed" => "fast"
      ],
      "out_task_id" => "my_task_123456"
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer <token>",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  url = URI("https://aireiter.com/api/openapi/submit")

  payload = {
    model: "mj_v8_2",
    params: {
      prompt: "A blue robot watering tulips in a sunny garden, storybook illustration",
      image_url: [
        "https://example.com/product.png",
        "https://example.com/style.png"
      ],
      aspect_ratio: "16:9",
      quality: "hd",
      speed: "fast"
    },
    out_task_id: "my_task_123456"
  }

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(url)
  request["Authorization"] = "Bearer <token>"
  request["Content-Type"] = "application/json"
  request.body = payload.to_json

  response = http.request(request)
  puts response.body
  ```

  ```swift Swift theme={null}
  import Foundation

  let url = URL(string: "https://aireiter.com/api/openapi/submit")!

  let payload: [String: Any] = [
      "model": "mj_v8_2",
      "params": [
          "prompt": "A blue robot watering tulips in a sunny garden, storybook illustration",
          "image_url": [
              "https://example.com/product.png",
              "https://example.com/style.png"
          ],
          "aspect_ratio": "16:9",
          "quality": "hd",
          "speed": "fast"
      ],
      "out_task_id": "my_task_123456"
  ]

  var request = URLRequest(url: url)
  request.httpMethod = "POST"
  request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
  request.setValue("application/json", forHTTPHeaderField: "Content-Type")
  request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

  let task = URLSession.shared.dataTask(with: request) { data, response, error in
      if let error = error {
          print("Error: \(error)")
          return
      }

      if let data = data, let responseString = String(data: data, encoding: .utf8) {
          print(responseString)
      }
  }

  task.resume()
  ```

  ```csharp C# theme={null}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main(string[] args)
      {
          var url = "https://aireiter.com/api/openapi/submit";

          var payload = @"{
              ""model"": ""mj_v8_2"",
              ""params"": {
                  ""prompt"": ""A blue robot watering tulips in a sunny garden, storybook illustration"",
                  ""image_url"": [
                      ""https://example.com/product.png"",
                      ""https://example.com/style.png""
                  ],
                  ""aspect_ratio"": ""16:9"",
                  ""quality"": ""hd"",
                  ""speed"": ""fast""
              },
              ""out_task_id"": ""my_task_123456""
          }";

          using var client = new HttpClient();
          client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");

          var content = new StringContent(payload, Encoding.UTF8, "application/json");
          var response = await client.PostAsync(url, content);
          var result = await response.Content.ReadAsStringAsync();

          Console.WriteLine(result);
      }
  }
  ```

  ```c C theme={null}
  #include <stdio.h>
  #include <curl/curl.h>

  int main(void) {
      CURL *curl;
      CURLcode res;

      curl_global_init(CURL_GLOBAL_DEFAULT);
      curl = curl_easy_init();

      if(curl) {
          const char *url = "https://aireiter.com/api/openapi/submit";
          const char *payload = "{"
              "\"model\":\"mj_v8_2\","
              "\"params\":{"
                  "\"prompt\":\"A blue robot watering tulips in a sunny garden, storybook illustration\","
                  "\"image_url\":[\"https://example.com/product.png\",\"https://example.com/style.png\"],"
                  "\"aspect_ratio\":\"16:9\","
                  "\"quality\":\"hd\"",
                  "\"speed\":\"fast\""
              "},"
              "\"out_task_id\":\"my_task_123456\""
          "}";

          struct curl_slist *headers = NULL;
          headers = curl_slist_append(headers, "Authorization: Bearer <token>");
          headers = curl_slist_append(headers, "Content-Type: application/json");

          curl_easy_setopt(curl, CURLOPT_URL, url);
          curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
          curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

          res = curl_easy_perform(curl);

          if(res != CURLE_OK) {
              fprintf(stderr, "curl_easy_perform() failed: %s\n",
                      curl_easy_strerror(res));
          }

          curl_slist_free_all(headers);
          curl_easy_cleanup(curl);
      }

      curl_global_cleanup();
      return 0;
  }
  ```

  ```objectivec Objective-C theme={null}
  #import <Foundation/Foundation.h>

  int main(int argc, const char * argv[]) {
      @autoreleasepool {
          NSURL *url = [NSURL URLWithString:@"https://aireiter.com/api/openapi/submit"];

          NSDictionary *payload = @{
              @"model": @"mj_v8_2",
              @"params": @{
                  @"prompt": @"A blue robot watering tulips in a sunny garden, storybook illustration",
                  @"image_url": @[@"https://example.com/product.png", @"https://example.com/style.png"],
                  @"aspect_ratio": @"16:9",
                  @"quality": @"hd",
                  @"speed": @"fast"
              },
              @"out_task_id": @"my_task_123456"
          };

          NSError *error;
          NSData *jsonData = [NSJSONSerialization dataWithJSONObject:payload
                                                            options:0
                                                              error:&error];

          NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
          [request setHTTPMethod:@"POST"];
          [request setValue:@"Bearer <token>" forHTTPHeaderField:@"Authorization"];
          [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
          [request setHTTPBody:jsonData];

          NSURLSessionDataTask *task = [[NSURLSession sharedSession]
              dataTaskWithRequest:request
              completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                  if (error) {
                      NSLog(@"Error: %@", error);
                      return;
                  }
                  NSString *result = [[NSString alloc] initWithData:data
                                                          encoding:NSUTF8StringEncoding];
                  NSLog(@"%@", result);
              }];

          [task resume];
          [[NSRunLoop mainRunLoop] run];
      }
      return 0;
  }
  ```

  ```ocaml OCaml theme={null}
  (* Requires cohttp and yojson libraries *)
  open Lwt
  open Cohttp
  open Cohttp_lwt_unix

  let url = "https://aireiter.com/api/openapi/submit"

  let payload = {|{
    "model": "mj_v8_2",
    "params": {
      "prompt": "A blue robot watering tulips in a sunny garden, storybook illustration",
      "image_url": [
        "https://example.com/product.png",
        "https://example.com/style.png"
      ],
      "aspect_ratio": "16:9",
      "quality": "hd",
      "speed": "fast"
    },
    "out_task_id": "my_task_123456"
  }|}

  let () =
    let headers = Header.init ()
      |> fun h -> Header.add h "Authorization" "Bearer <token>"
      |> fun h -> Header.add h "Content-Type" "application/json"
    in
    let body = Cohttp_lwt.Body.of_string payload in

    let response = Client.post ~headers ~body (Uri.of_string url) >>= fun (resp, body) ->
      body |> Cohttp_lwt.Body.to_string >|= fun body_str ->
      print_endline body_str
    in
    Lwt_main.run response
  ```

  ```dart Dart theme={null}
  import 'dart:convert';
  import 'package:http/http.dart' as http;

  void main() async {
    final url = Uri.parse('https://aireiter.com/api/openapi/submit');

    final payload = {
      'model': 'mj_v8_2',
      'params': {
        'prompt': 'A blue robot watering tulips in a sunny garden, storybook illustration',
        'image_url': [
          'https://example.com/product.png',
          'https://example.com/style.png'
        ],
        'aspect_ratio': '16:9',
        'quality': 'hd',
        'speed': 'fast'
      },
      'out_task_id': 'my_task_123456'
    };

    final response = await http.post(
      url,
      headers: {
        'Authorization': 'Bearer <token>',
        'Content-Type': 'application/json'
      },
      body: jsonEncode(payload),
    );

    print(response.body);
  }
  ```

  ```r R theme={null}
  library(httr)
  library(jsonlite)

  url <- "https://aireiter.com/api/openapi/submit"

  payload <- list(
    model = "mj_v8_2",
    params = list(
      prompt = "A blue robot watering tulips in a sunny garden, storybook illustration",
      image_url = c(
        "https://example.com/product.png",
        "https://example.com/style.png"
      ),
      aspect_ratio = "16:9",
      quality = "hd",
      speed = "fast"
    ),
    out_task_id = "my_task_123456"
  )

  response <- POST(
    url,
    add_headers(
      Authorization = "Bearer <token>",
      `Content-Type` = "application/json"
    ),
    body = toJSON(payload, auto_unbox = TRUE),
    encode = "raw"
  )

  cat(content(response, "text"))
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "statusCode": 200,
    "message": "",
    "data": {
      "out_task_id": "my_task_123456",
      "status": "pending",
      "created_at": "2026-10-08T06:03:28.242Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "statusCode": 400,
    "message": "요청 매개변수가 올바르지 않습니다",
    "ok": false
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "인증에 실패했습니다. API 키를 확인해 주세요"
    }
  }
  ```

  ```json 433 theme={null}
  {
    "error": {
      "code": 433,
      "message": "계정 잔액이 부족합니다. 충전 후 다시 시도해 주세요"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "서버 내부 오류가 발생했습니다. 잠시 후 다시 시도해 주세요"
    }
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.