비동기 작업 라이프사이클
AetherAI API의 모든 생성 작업은 비동기로 처리됩니다. 작업을 생성한 후 폴링을 통해 상태를 확인해야 합니다.
작업 생성
POST 요청을 보내면 즉시 job_id가 반환됩니다. 이미지 처리는 백그라운드에서 진행됩니다.
요청 예시
curl -X POST "https://api.aetherforgeai.com/public/v1/generate/image" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A beautiful sunset over mountains",
"ai_model": "GPT Image 1.5"
}'
응답 예시
{
"job_id": "550e8400-e29b-41d4-a716-446655440000"
}
작업 상태 폴링
반환된 job_id로 GET 요청을 보내 작업 상태를 확인합니다.
curl -X GET "https://api.aetherforgeai.com/public/v1/job/{job_id}" \
-H "Authorization: Bearer your_api_key_here"
상태 값
| 상태 | 설명 |
|---|---|
Pending | 작업이 대기 중이거나 처리 중입니다 |
Succeed | 작업이 성공적으로 완료되었습니다 |
Failed | 작업 처리 중 오류가 발생했습니다 |
상태별 응답 예시
Pending
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "Pending",
"image_urls": []
}
Succeed
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "Succeed",
"image_urls": [
"https://cdn.aetherforgeai.com/images/abc123.png",
"https://cdn.aetherforgeai.com/images/abc123.gif"
]
}
Failed
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "Failed",
"image_urls": []
}
폴링 전략
작업 완료를 확인하기 위해 다음 간격으로 폴링하는 것을 권장합니다.
- 초기 폴링: 작업 생성 후 1초
- 이후 간격: 2~5초
- 최대 폴링 시간: 1분 (작업 유형에 따라 다름)