Skip to main content
GET
중국 본토 사용자 안내: 중국 본토 사용자는 https://toapis.cn 를 API 엔드포인트(Base URL)로 사용해 주세요. 본 문서의 예시에서 https://toapis.com 을 https://toapis.cn 로 바꿔 주세요.
  • Query async image generation task execution status and results
  • Real-time status updates and progress tracking
  • Get generated images when task completes
  • Multi-language support (zh/en/ko/ja)
All image generation tasks are executed asynchronously. After submitting a task, you need to query the status and results via the query endpoint.

Authorizations

string
필수
All endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:

Path 파라미터

string
필수
Task ID returned by the image generation API

응답

string
Unique task identifier
string
Object type, always generation.task
string
Task status
  • queued - Queued for processing
  • in_progress - Processing
  • completed - Successfully completed
  • failed - Failed
string
Image generation model used
integer
Task creation time (Unix timestamp)
integer
Task completion time (Unix timestamp, only returned when completed)
string
Generated image URL (only returned on success)
integer
Image URL expiration time (Unix timestamp, only returned on completion)
object
Task result (only returned on success)
object
선택적으로 반환되는 이미지 작업 과금 정보입니다. 과금 상태는 생성 상태와 별개이므로 completed여도 정산이 완료되었다고 단정할 수 없습니다. 과금 정보를 확인할 수 없으면 billing 전체를 생략하며 null을 반환하지 않습니다. 생략되었다고 무료인 것은 아닙니다.
object
선택적으로 반환되는 정산 완료 이미지 토큰 사용량입니다. billing.status가 settled이고 저장된 사용량이 유효하며 최종 청구 금액과 일치할 때만 이미지 토큰 필드를 반환합니다. 사용량이 없거나 검증할 수 없으면 생략하며, 추정하거나 0으로 대체하지 않습니다. 확정된 금액과 이미지 결과는 계속 반환할 수 있습니다.모든 토큰 수는 음수가 아닌 JSON 정수입니다. 캐시된 토큰은 입력 토큰의 일부이므로 다시 더하지 마세요. 출력 세부 정보가 없으면 output_tokens_details 전체를 생략합니다. usage.tool_usage.web_search는 단독으로 반환되거나 이미지 토큰과 함께 반환될 수 있습니다.
object
오류 information (only returned on failure)

과금 상태와 비용 집계

이 과금 규칙은 모델이나 채널에 관계없이 이미지 작업 조회에 적용됩니다. GPT-Image-2.5의 Sunburst 및 Flare VIP / Official 모델은 토큰 사용량을 지원하며, 다른 모델의 반환 여부는 저장된 정산 데이터에 따라 달라집니다. 예시 금액은 응답 형식을 설명하며 고정 단가가 아닙니다.
  • 금액은 작업의 확정된 최종 청구액입니다. 조회는 과금, 추가 청구, 환불 또는 현재 모델 가격에 따른 재계산을 수행하지 않습니다. 비용 집계에는 반환된 금액을 사용하고, 토큰 수에 현재 단가를 곱해 대체하지 마세요.
  • 작업 id별로 금액을 갱신하고, 폴링할 때마다 같은 금액을 누적하지 마세요. 십진수 연산을 사용하세요. pending이거나 필드가 없으면 비용을 알 수 없는 것이며 0으로 처리하면 안 됩니다.
  • 금액은 십진수 문자열이며 소수 자릿수는 고정되어 있지 않습니다.
  • 과금 기록이 없거나 일관되지 않으면 billing이 생략될 수 있습니다. 이미지가 아직 전달 가능한 상태가 아니어서 작업이 일시적으로 in_progress로 표시되는 경우 billing과 usage가 모두 생략될 수도 있습니다.
  • 성공 Webhook의 data.usage에는 같은 이미지 토큰 필드가 포함될 수 있으며 data.billing에는 확정 청구 금액이 포함될 수 있습니다. 어느 한쪽이 없으면 이 엔드포인트를 대체 경로로 조회하세요. 가격 및 실제 청구 금액도 참고하세요.

Task 상태 Reference

Polling Strategy

Python Polling Example

Resource Expiration

Generated image URLs are valid for 24 hours
  • Please download and save images within the validity period
  • expires_at field indicates image expiration time (Unix timestamp)
  • Expired images cannot be accessed; to regenerate, submit a new task

오류 Codes

ToAPIs 통합 Task Webhook을 우선 사용하고 조회는 대체 경로로 사용하세요. 5~10초 이상과 지터, 429의 Retry-After를 따르세요. 배치는 최대 100개입니다. 속도 제한.