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

# 이미지 편집

> <ul><li>원본 이미지와 프롬프트를 기반으로 편집 또는 확장 이미지를 생성합니다.</li></ul>

<RequestExample>
  ```bash cURL theme={null} theme={null}
  curl --request POST \
    --url 'https://api.elkapi.com/v1/images/edits' \
    --header 'Authorization: Bearer <token>' \
    --form 'image=@https://example.com/image.png' \
    --form 'mask=@file.bin' \
    --form 'prompt=햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일' \
    --form 'n=1' \
    --form 'size=1024x1024' \
    --form 'response_format=json' \
    --form 'user=' \
    --form 'model=gpt-image-1.5'
  ```

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

  url = "https://api.elkapi.com/v1/images/edits"
  headers = {
      "Authorization": "Bearer <token>"
  }
  files = {
      "image": open("https://example.com/image.png", "rb"),
      "mask": open("file.bin", "rb"),
  }
  data = {
      "prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
      "n": "1",
      "size": "1024x1024",
      "response_format": "json",
      "user": "",
      "model": "gpt-image-1.5",
  }

  response = requests.request("POST", url, headers=headers, data=data, files=files)
  print(response.text)
  ```

  ```javascript JavaScript theme={null} theme={null}
  const url = "https://api.elkapi.com/v1/images/edits";

  const headers = {
    "Authorization": "Bearer <token>"
  };
  const form = new FormData();
  form.append("image", fileInput.files[0]);
  form.append("mask", fileInput.files[0]);
  form.append("prompt", "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일");
  form.append("n", "1");
  form.append("size", "1024x1024");
  form.append("response_format", "json");
  form.append("user", "");
  form.append("model", "gpt-image-1.5");

  const response = await fetch(url, {
    method: "POST",
    headers,
    body: form
  });

  console.log(await response.text());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null} theme={null}
  {}
  ```
</ResponseExample>

## Authorizations

<ParamField header="Authorization" type="string" required>
  모든 엔드포인트는 Bearer Token 인증이 필요합니다.

  요청 헤더에 추가하세요:

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

## Body

<ParamField body="image" type="file" required>
  편집할 이미지입니다. 유효한 PNG 파일이어야 하며 4MB 미만이고 정사각형이어야 합니다. 마스크가 제공되지 않으면 이미지는 투명도를 포함해야 하며 이 투명도가 마스크로 사용됩니다.

  예시: `cmMtdXBsb2FkLTE2ODc4MzMzNDc3NTEtMjA=/31225951_59371037e9_small.png`
</ParamField>

<ParamField body="mask" type="file">
  추가 이미지입니다. 완전히 투명한 영역(예: alpha가 0인 영역)이 image를 편집할 위치를 나타냅니다. 유효한 PNG 파일이어야 하며 4MB 미만이고 원본 image와 크기가 같아야 합니다.

  예시: \`\`
</ParamField>

<ParamField body="prompt" type="string" required>
  원하는 이미지에 대한 텍스트 설명입니다. 최대 길이는 1000자입니다.

  예시: `A cute baby sea otter wearing a beret.`
</ParamField>

<ParamField body="n" type="string">
  생성할 이미지 수입니다. 1\~10 사이여야 합니다.

  예시: `1`
</ParamField>

<ParamField body="size" type="string">
  생성 이미지 크기입니다. `256x256`, `512x512`, `1024x1024` 중 하나여야 합니다.

  예시: `1024x1024`
</ParamField>

<ParamField body="response_format" type="string">
  생성 이미지의 반환 형식입니다. `url` 또는 `b64_json`이어야 합니다.

  예시: `url`
</ParamField>

<ParamField body="user" type="string">
  최종 사용자를 나타내는 고유 식별자이며 OpenAI가 남용을 모니터링하고 감지하는 데 도움이 됩니다.[자세히 보기](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids).

  예시: \`\`
</ParamField>

<ParamField body="model" type="string" default="gpt-image-1.5">
  예시: `gpt-image-1.5`
</ParamField>

## Response
