curl --request POST \
--url 'https://api.elkapi.com/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/images/generations"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/images/generations";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"created": 1,
"data": [
{
"b64_json": "b64_json",
"url": "https://example.com/image.png"
}
],
"usage": {
"total_tokens": 1,
"input_tokens": 1,
"output_tokens": 1,
"input_tokens_details": {
"text_tokens": 1,
"image_tokens": 1
}
}
}
네이티브 OpenAI 형식
이미지 생성
- 제공된 프롬프트로 이미지를 생성합니다.자세히 보기.
POST
/
v1
/
images
/
generations
curl --request POST \
--url 'https://api.elkapi.com/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/images/generations"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/images/generations";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"created": 1,
"data": [
{
"b64_json": "b64_json",
"url": "https://example.com/image.png"
}
],
"usage": {
"total_tokens": 1,
"input_tokens": 1,
"output_tokens": 1,
"input_tokens_details": {
"text_tokens": 1,
"image_tokens": 1
}
}
}
curl --request POST \
--url 'https://api.elkapi.com/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": false
}'
import requests
url = "https://api.elkapi.com/v1/images/generations"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": False
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/images/generations";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"prompt": "햇살이 비치는 정원에서 달리는 작은 고양이, 영화적인 느낌, 높은 디테일",
"model": "gpt-image-1.5",
"size": "1024x1024",
"stream": false
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
{
"created": 1,
"data": [
{
"b64_json": "b64_json",
"url": "https://example.com/image.png"
}
],
"usage": {
"total_tokens": 1,
"input_tokens": 1,
"output_tokens": 1,
"input_tokens_details": {
"text_tokens": 1,
"image_tokens": 1
}
}
}
Authorizations
string
필수
모든 엔드포인트는 Bearer Token 인증이 필요합니다.요청 헤더에 추가하세요:
Authorization: Bearer YOUR_API_KEY
Body
string
기본값:"gpt-image-1.5"
이미지 생성에 사용할 모델입니다.
dall-e-2, dall-e-3, gpt-image-1 중 하나입니다. gpt-image-1 전용 파라미터를 사용하지 않는 한 기본값은 dall-e-2입니다.예시: gpt-image-1.5string
필수
원하는 이미지에 대한 텍스트 설명입니다. 최대 길이는
gpt-image-1의 경우 32,000자, dall-e-2의 경우 1,000자, dall-e-3의 경우 4,000자입니다.integer
생성할 이미지 수입니다. 1~10 사이여야 합니다.
dall-e-3는 n=1만 지원합니다.string
생성 이미지 크기입니다.
gpt-image-1의 경우 1024x1024, 1536x1024(가로), 1024x1536(세로), auto(기본값) 중 하나여야 합니다. dall-e-2의 경우 256x256, 512x512, 1024x1024 중 하나여야 하며, dall-e-3의 경우 1024x1024, 1792x1024, 1024x1792 중 하나여야 합니다.string
생성 이미지의 배경 투명도를 설정할 수 있습니다. 이 파라미터는
gpt-image-1에서만 지원됩니다. transparent, opaque, auto(기본값) 중 하나여야 합니다. auto를 사용하면 모델이 이미지에 가장 적합한 배경을 자동으로 결정합니다.배경이 transparent인 경우 출력 형식이 투명도를 지원해야 하므로 png(기본값) 또는 webp로 설정해야 합니다.string
gpt-image-1이 생성한 이미지의 콘텐츠 모더레이션 수준을 제어합니다. 덜 제한적인 필터링에는 low, 기본값에는 auto를 사용합니다.string
생성 이미지의 품질입니다.
string
string
string
Response
integer