Overview
All generation requests follow the same basic lifecycle:Job States
queued Job is waiting in the queue to be processed backlogged Job is waiting behind your current concurrency limit scheduled Job has been accepted and scheduled for processing processing Job is actively being processed by a worker sampling Job is generating output samples intermediate-complete Job has an intermediate result and may continue processing completed Job finished successfully, result available inresult.urls
failed Job failed due to an error, details in result.error
cancelled Job was cancelled by the user or system
Failures & Cancellation
Jobs can fail for several reasons:- API errors from the generation service
- Invalid parameters or unsupported configurations
- Content moderation (NSFW filtering)
- Automatic timeout detection (3 minutes for hosted tools, 2 hours for external providers)
DELETE request to /jobs/{id}. Note: Jobs can only be canceled while they have a status of queued or processing.
Important: Failed and cancelled jobs are not billed. You only pay for completed jobs.
Checking Job Status
Poll for job status using aGET request to /jobs/{id}. Recommended practices:
- Poll every 2-5 seconds while job is pending (
backlogged,queued,scheduled,processing,sampling, orintermediate-complete) - Use exponential backoff for longer-running jobs
- Stop polling when status is completed, failed, or cancelled
- Some jobs may include preview images in responses during processing
Next Steps
Webhooks
Receive notifications when jobs complete
Rate Limits
Understand API limits by plan tier
Model APIs
Explore all available endpoints and parameters
API Keys & Billing
Create and manage your API keys