Jobs API
Check the status of asynchronous generation jobs and retrieve their results.
Get Job Status
GET
/api/v1/jobs/:idReturns the current status and result of a job. Use this to poll for completion of long-running tasks.
Example
bash
curl "https://railwail.com/api/v1/jobs/job_abc123" \
-H "Authorization: Bearer rw_live_xxxxx"Response
JSON
{
"id": "job_abc123",
"object": "job",
"status": "completed",
"model": {
"name": "Flux 1.1 Pro",
"slug": "flux-1.1-pro",
"category": "image",
"provider": "black-forest-labs"
},
"input": {
"prompt": "A sunset over Tokyo",
"size": "1024x1024"
},
"output": null,
"output_url": "https://cdn.railwail.com/outputs/abc123.png",
"cost": {
"credits": 10,
"currency": "credits"
},
"tokens": null,
"timing": {
"created_at": 1700000000,
"started_at": 1700000001,
"completed_at": 1700000005,
"latency_ms": 1000,
"duration_ms": 4000
},
"error": null
}Job Statuses
| Status | Description |
|---|---|
queued | Job is waiting to be processed |
processing | Job is currently being processed |
completed | Job finished successfully — check output_url |
failed | Job failed — check the error field |
cancelled | Job was cancelled |
Polling strategy
We recommend polling every 2 seconds for most jobs. For video generation, consider polling every 5-10 seconds as these can take longer.