> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rawchunks.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Generation status

> Poll a generation and retrieve persisted audio.

Use `primaryUrl` only when the body says `status: "ready"`. Keep the original task/song pair. A mismatched pair returns 409.

[Polling and streams](/dev/guides/jobs).

## Headers and parameters

<ParamField path="taskId" type="string" required>
  Resource ID.
</ParamField>

<ParamField query="songId" type="string" required>
  Song ID returned by the same submission.
</ParamField>

## Response (200)

Success.

<ResponseField name="status" type="string" required>
  Values: `pending`, `processing`, `ready`, `error`.
</ResponseField>

<ResponseField name="progress" type="number">
  Progress percentage when available.
</ResponseField>

<ResponseField name="error" type="string" />

<ResponseField name="primaryUrl" type="string">
  Present on ready. Primary persisted audio URL.
</ResponseField>

<ResponseField name="audioUrls" type="string[]" />

<ResponseField name="songAId" type="string">
  Primary song ID on ready.
</ResponseField>

<ResponseField name="songBId" type="string">
  Optional additional result ID.
</ResponseField>

<ResponseField name="duration" type="number">
  Decoded output duration in seconds.
</ResponseField>

<ResponseField name="durations" type="number[]" />

## Errors

Failed JSON responses contain an `error` string. Check the HTTP status before reading a successful result. See [job handling](/dev/guides/jobs) for interrupted or uncertain submissions.

| Status | Meaning |
| - | - |
| `400` | Invalid request. |
| `500` | Request failed. |

<RequestExample>
  ```bash cURL theme={null}
  curl --fail-with-body -X GET "$RAWCHUNKS_API/api/generation/status/$(jq -nr --arg v "$TASK_ID" '$v|@uri')?songId=$(jq -nr --arg v "$SONG_ID" '$v|@uri')"
  ```
</RequestExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.