강력한 AI 모델로 아이디어를 멋진 이미지와 동영상으로 변환하세요
여러 모델과 출력 형식으로 이미지 생성 API를 테스트하고 탐색하세요
fetch('https://api.imagegpt.online/generate/text-image', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
"prompt": "Photorealistic portrait of the same person (keep his real face unchanged). A man with medium curly brown hair, light skin, and soft features sits relaxed, forearms on a light blue table, holding a small white puppy with a red collar. He wears a cozy color-block knitted sweater (beige, tan, light blue, black) with ribbed neck and cuffs, a silver watch, and a turquoise-beaded bracelet. Soft diffused lighting, smooth steel-blue background, slightly elevated front angle warm, intimate, digital photo",
"width": 512,
"height": 512,
"model": "FLUX-SCHNELL",
"outputType": "binary",
"outputFormat": "png"
})
})
.then(response => response.blob())
.then(blob => {
const imageUrl = URL.createObjectURL(blob);
console.log('Image URL:', imageUrl);
// Display in img tag: document.getElementById('myImg').src = imageUrl;
})
.catch(error => console.error('Error:', error));15개 이상의 AI 모델을 사용하여 이미지를 생성하는 통합 REST API — 텍스트-투-이미지 및 이미지-투-이미지 생성을 다양한 출력 형식으로 지원, 크레딧 기반 요금제.
https://api.imagegpt.online/generate/text-image모든 요청에는 헤더에 API 키를 포함해야 합니다. API 키를 비밀로 유지하세요.
x-api-key: YOUR_API_KEY누락되거나 잘못된 API 키는 401 Unauthorized 응답을 반환합니다.
다음 필드를 포함한 JSON 본문을 전송하세요:
| 파라미터 | 타입 | 기본값 | 설명 |
|---|---|---|---|
model* | string | — | 생성에 사용할 모델 ID. |
prompt* | string | — | 생성할 이미지의 텍스트 설명. |
width | number | 512 | 출력 이미지 너비(픽셀). |
height | number | 512 | 출력 이미지 높이(픽셀). |
outputType | string | "binary" | 출력 형식: "binary", "url" 또는 "base64". |
outputFormat | string | "png" | 이미지 파일 형식: "png" 또는 "jpg". |
image | string[] | — | 입력 이미지 URL 배열(최대 3). 이미지-투-이미지에만 필수. |
* 필수 필드.
응답 형태는 선택한 outputType 에 따라 달라집니다:
outputType: "binary"
const blob = await response.blob();
const url = URL.createObjectURL(blob);outputType: "url"
{
"success": true,
"taskId": "imagegpt_img-...",
"url": "https://...",
"creditsDeducted": 3
}outputType: "base64"
{
"success": true,
"taskId": "imagegpt_img-...",
"base64": "/9j/4QWm...",
"creditsDeducted": 3
}fetch API를 사용한 최소한의 텍스트-투-이미지 요청:
fetch('https://api.imagegpt.online/generate/text-image', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
model: 'FLUX-SCHNELL',
prompt: 'A futuristic city at sunset, photorealistic',
width: 512,
height: 512,
outputType: 'url',
outputFormat: 'png'
})
})
.then(res => res.json())
.then(data => console.log('Image URL:', data.url));이미지-투-이미지의 경우 image 배열을 추가하세요:
body: JSON.stringify({
model: 'FLUX-KONTEXT',
prompt: 'Same person, wearing a red jacket',
image: ['https://example.com/input.jpg'],
width: 512,
height: 512,
outputType: 'url',
outputFormat: 'png'
})크레딧은 생성된 이미지당 부과됩니다:
초안에 적합한 미리 경량 모델.
e.g. Flux Schnell, Z Image Turbo
일상적인 생성 작업에 균형 잡힌 품질.
e.g. GPT Image 1.0, Seedream, Nova Canvas
프로덕션 품질을 위한 최고 충실도.
e.g. Nano Banana Pro, Seedream 4.0, Ideogram
ImageGPT는 NSFW, 성적으로 노골적인 성인, 착취적, 기만적이거나 유해한 AI 생성 콘텐츠를 금지합니다. 지원되는 이미지 및 동영상 생성에 콘텐츠 조정이 적용됩니다.