List generations
curl --request GET \
--url https://api.zerogen.com/v1/generations \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"projectId": "<string>",
"model": "<string>",
"modelVersion": "<string>",
"status": "queued",
"outputs": [
{
"index": 4503599627370495,
"status": "queued",
"asset": {
"id": "<string>",
"mimeType": "<string>",
"width": 4503599627370495,
"height": 4503599627370495,
"durationMs": 4503599627370495,
"resourceUri": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
},
"warnings": [
{
"code": "<string>",
"message": "<string>"
}
],
"draft": {
"expiresAt": "2023-11-07T05:31:56Z",
"upscalable": true,
"upscale": "upscaling",
"finalResolution": "<string>",
"finalAssetId": "<string>"
}
}
],
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
},
"billing": {
"mode": "platform",
"state": "held",
"quotedMicroUsd": 4503599627370495,
"heldMicroUsd": 4503599627370495,
"chargedMicroUsd": 4503599627370495,
"hold": {
"state": "running",
"endedAt": "2023-11-07T05:31:56Z"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Generations
List generations
The calling key owner’s generations, newest first.
Needs the generations:read scope.
GET
/
generations
List generations
curl --request GET \
--url https://api.zerogen.com/v1/generations \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/generations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"projectId": "<string>",
"model": "<string>",
"modelVersion": "<string>",
"status": "queued",
"outputs": [
{
"index": 4503599627370495,
"status": "queued",
"asset": {
"id": "<string>",
"mimeType": "<string>",
"width": 4503599627370495,
"height": 4503599627370495,
"durationMs": 4503599627370495,
"resourceUri": "<string>"
},
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
},
"warnings": [
{
"code": "<string>",
"message": "<string>"
}
],
"draft": {
"expiresAt": "2023-11-07T05:31:56Z",
"upscalable": true,
"upscale": "upscaling",
"finalResolution": "<string>",
"finalAssetId": "<string>"
}
}
],
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
},
"billing": {
"mode": "platform",
"state": "held",
"quotedMicroUsd": 4503599627370495,
"heldMicroUsd": 4503599627370495,
"chargedMicroUsd": 4503599627370495,
"hold": {
"state": "running",
"endedAt": "2023-11-07T05:31:56Z"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"param": "<string>",
"details": {}
}
}Authorizations
A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.
Query Parameters
Only generations in this project
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Only generations filed in this folder; needs projectId
Pattern:
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Generations per page; default 10
Required range:
1 <= x <= 20nextCursor from the previous page, with the same filters