Retrieve a Kling 4.0 task
curl --request GET \
--url https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "kling40:01234567-89ab-cdef-0123-456789abcdef",
"model": "kling-4.0",
"status": "processing",
"outputs": {
"videos": [],
"images": []
}
}Kling 4.0
Retrieve a Kling 4.0 task
Query the status and output of an existing task using its public Kling 4.0 ID.
GET
/
contents
/
generations
/
tasks
/
{id}
Retrieve a Kling 4.0 task
curl --request GET \
--url https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://gengen.farm/api/gengen/v1/contents/generations/tasks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "kling40:01234567-89ab-cdef-0123-456789abcdef",
"model": "kling-4.0",
"status": "processing",
"outputs": {
"videos": [],
"images": []
}
}
Use the GENGEN API key that owns the task and preserve the complete
kling40: ID returned by creation.
Poll until succeeded or failed. A successful result contains outputs.videos; save the video to your own storage because download links expire. Query the task again to obtain a refreshed link. Success is returned after output storage and billing settlement; repeated queries do not charge for generation again.
Do not submit a replacement task after a timeout or uncertain creation response. If no task ID was returned, contact support before retrying.
Usage
On success,usage.hasVideoInput indicates whether video input affected the charge. Without video input, billableSeconds equals outputDurationSeconds. With video input, it equals outputDurationSeconds + max(inputVideoDurationSeconds, outputDurationSeconds). For example, 8 seconds of input and 5 seconds of output give 13 billable seconds.
usage.resolution is the pricing tier string. Multiply billableSeconds by the per-second rate for usage.priceRowId in the price catalog.Path Parameters
Response
Task status. Save the complete public ID. Success is delivered after output storage and settlement.
pending: Task accepted and awaiting processing.processing: Generation, output storage or billing settlement is in progress.succeeded: Output is stored and billing is settled; readoutputs.videos.failed: Task failed; seefailureReason.
Available options:
pending, processing, succeeded, failed