curl --request GET \
--url https://api.zerogen.com/v1/assets \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/assets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"projectId": "<string>",
"name": "<string>",
"type": "image",
"origin": "generated",
"mimeType": "<string>",
"sizeBytes": 4503599627370495,
"width": 4503599627370495,
"height": 4503599627370495,
"durationMs": 4503599627370495,
"favorite": true,
"labels": [
{
"id": "<string>",
"name": "<string>"
}
],
"runId": "<string>",
"outputIndex": 4503599627370495,
"createdAt": "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": {}
}
}Search assets
Library assets, newest first unless sort says otherwise. Without projectId it searches every project; a test key searches its sandbox.
Needs the library:read scope.
curl --request GET \
--url https://api.zerogen.com/v1/assets \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/assets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "<string>",
"projectId": "<string>",
"name": "<string>",
"type": "image",
"origin": "generated",
"mimeType": "<string>",
"sizeBytes": 4503599627370495,
"width": 4503599627370495,
"height": 4503599627370495,
"durationMs": 4503599627370495,
"favorite": true,
"labels": [
{
"id": "<string>",
"name": "<string>"
}
],
"runId": "<string>",
"outputIndex": 4503599627370495,
"createdAt": "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 assets in this project
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Only assets directly in this folder, or unfiled for assets in no folder; with q, also its subfolders. Needs projectId
^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Only the organization's favorites
"true"Only assets with any of these active labels; repeat the parameter
100^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$Search asset names: at least two characters, and every one of the first eight words must match, ignoring case
2 - 200Only this media type
image, video, audio, model3d Only assets that came about this way
generated, upload, derived Only assets in any of these resolution tiers; repeat the parameter
4k, 1440p, 1080p, 720p, sd, 2k, 1k, 0.5k Order by creation; default newest
newest, oldest Assets per page; default 20
1 <= x <= 50nextCursor from the previous page, with the same filters