API reference

Get generation progress

Fetch progress and job stages for a generation.

Fetch progress and stage details for a generation.

POST/v1/get_generation_progressPermissions: read

Endpoint

HTTP request

https://api.diffio.ai/v1/get_generation_progress

Use POST with a JSON body.

Permissions

read

API keys must be active.

Authentication

Send the API key on every request using one of the supported headers.

  • Authorization: Bearer <apiKey>
  • X-Api-Key: <apiKey>
  • Xi-Api-Key: <apiKey>

Request

Provide a generation id and optionally the project id.

Body fields

FieldTypeRequiredDescription
generationIdstringYesGeneration identifier returned by a generation request.
apiProjectIdstringNoOptional project id to speed up the lookup.
cURL
curl -X POST "https://api.diffio.ai/v1/get_generation_progress" \  -H "Authorization: Bearer $DIFFIO_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "generationId": "gen-123",    "apiProjectId": "proj-123"  }'

Response

Returns the overall status plus stage objects for each job step.

Response fields

FieldTypeRequiredDescription
generationIdstringYesGeneration identifier for the request.
apiProjectIdstringYesProject identifier for the generation.
statusstringYesOverall status for the generation.
hasVideobooleanYesTrue when the project includes video.
preProcessingobjectNoStage object for preprocessing.
inferenceobjectNoStage object for inference.
restoredVideoobjectNoStage object for video restoration when present.
errorstringNoError summary when a stage fails.
errorDetailsstringNoDetailed error information when available.
Successful response
{  "generationId": "gen-123",  "apiProjectId": "proj-123",  "status": "processing",  "hasVideo": true,  "preProcessing": {    "jobId": "job-pre",    "jobState": "SUCCEEDED",    "status": "complete",    "progress": 100,    "statusMessage": null,    "error": null,    "errorDetails": null  },  "inference": {    "jobId": "job-cloud-run-gpu",    "jobState": "RUNNING",    "status": "running",    "progress": 45,    "statusMessage": "Processing audio",    "error": null,    "errorDetails": null  },  "restoredVideo": {    "jobId": "job-restored",    "jobState": "PENDING",    "status": "pending",    "progress": 0,    "statusMessage": "Queued",    "error": null,    "errorDetails": null  }}

Stage object

Stage object
{  "jobId": "job-123",  "jobState": "RUNNING",  "status": "running",  "progress": 30,  "statusMessage": "Processing",  "error": null,  "errorDetails": null}

Stage object fields

Stage objects share the same fields across preProcessing, inference, and restoredVideo.

FieldTypeRequiredDescription
jobIdstringNoJob identifier when available.
jobStatestringNoCloud job state, for example RUNNING or SUCCEEDED.
statusstringYesStage status, for example pending, running, complete, or failed.
progressnumberYesProgress percentage from 0 to 100.
statusMessagestringNoOptional status message for the current stage.
errorstringNoError summary when the stage fails.
errorDetailsstringNoDetailed error information when available.

Return codes

  • 200Success, treated as complete.: Progress returned.
  • 204Success, treated as empty response.: CORS preflight when method is OPTIONS.
  • 400Bad request, treated as client error.: Invalid JSON body, generationId must be provided as a string, apiProjectId must be a string when provided.
  • 401Unauthorized, treated as auth error.: Missing API key, or invalid API key.
  • 403Forbidden, treated as permission error.: API key is not active, missing read permission, or does not own the project or generation.
  • 404Not found, treated as missing resource.: Generation not found.
  • 405Client error, treated as fix required.: Method is not POST.

Notes

  • generationId is required and apiProjectId is optional.
  • Overall status values are pending, processing, complete, failed.
  • Audio projects return preProcessing and inference only.
  • Video projects include restoredVideo and complete when all stages are complete.
  • When a stage fails, the top level status is failed and error fields are populated.
  • preProcessing reports complete when audioOriginalMp3Ready is true even if the job document is missing.
  • When a stage is missing, it reports pending with progress set to 0.