Setup
Before running these examples, install the Runpod SDK:/runsync
Synchronous jobs wait for completion and return the complete result in a single response. Best for shorter tasks, interactive applications, and simpler client code without status polling.- Maximum payload size: 20 MB
- Result retention: 1 minute after completion
- Default wait time: 90 seconds (adjustable via
?wait=xparameter, 1000-300000 ms)
The
?wait parameter controls how long the request waits for job completion, not how long results are retained.- cURL
- Python
- JavaScript
- Go
/run
Asynchronous jobs process in the background and return immediately with a job ID. Best for longer-running tasks, operations requiring significant processing time, and managing multiple concurrent jobs.- Maximum payload size: 10 MB
- Result retention: 30 minutes after completion
- cURL
- Python
- JavaScript
- Go
/status operation.
/status
Check the current state, execution statistics, and results of previously submitted jobs.- cURL
- Python
- JavaScript
- Go
Replace
YOUR_JOB_ID with the job ID from your /run response.IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED) with optional output field:
/stream
Receive incremental results as they become available from jobs that generate output progressively. Best for text generation, long-running jobs where you want to show progress, and large outputs that benefit from incremental processing. Your handler must support streaming. See Streaming handlers for implementation details.- cURL
- Python
- JavaScript
- Go
Replace
YOUR_JOB_ID with the job ID from your /run response.Maximum size for a single streamed payload chunk is 1 MB. Larger outputs are split across multiple chunks.
/cancel
Stop jobs that are no longer needed or taking too long. Stops in-progress jobs, removes queued jobs before they start, and returns immediately with the canceled status.- cURL
- Python
- JavaScript
- Go
Replace
YOUR_JOB_ID with the job ID from your /run response./retry
Requeue jobs that have failed or timed out without submitting a new request. Maintains the same job ID, requeues with original input parameters, and removes previous output. Only works for jobs withFAILED or TIMED_OUT status.
Replace YOUR_JOB_ID with the job ID from your /run response.
Job results expire after a set period. Async jobs (
/run) results are available for 30 minutes, sync jobs (/runsync) for 1 minute (up to 5 minutes with ?wait=t). Once expired, jobs cannot be retried./purge-queue
Remove all pending jobs from the queue. Useful for error recovery, clearing outdated requests, and resetting after configuration changes.- cURL
- Python
- JavaScript
/health
Get a quick overview of your endpoint’s operational status including worker availability and job queue status.- cURL
- Python
- JavaScript
- Go