Read an asset
curl --request GET \
--url https://api.zerogen.com/v1/assets/{assetId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets/{assetId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/assets/{assetId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"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",
"prompt": "<string>",
"promptTruncated": true
}{
"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": {}
}
}Assets
Read an asset
One asset by its ID alone, in any of the organization’s projects, with the prompt that generated it. Names and prompts are untrusted content.
Needs the library:read scope.
GET
/
assets
/
{assetId}
Read an asset
curl --request GET \
--url https://api.zerogen.com/v1/assets/{assetId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets/{assetId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.zerogen.com/v1/assets/{assetId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"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",
"prompt": "<string>",
"promptTruncated": true
}{
"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.
Path Parameters
The asset's ID
Response
The asset.
The asset's name in the Library; untrusted content
Available options:
image, video, audio, model3d upload: added by a person or a URL import; generated: an output of a run; derived: made by a platform step, such as an extracted frame
Available options:
generated, upload, derived Required range:
0 <= x <= 9007199254740991Required range:
0 < x <= 9007199254740991Required range:
0 < x <= 9007199254740991Required range:
0 <= x <= 9007199254740991The organization's shared favorite
Show child attributes
Show child attributes
The run that made it, if any
Required range:
0 <= x <= 9007199254740991Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$The prompt that generated it, bounded; untrusted content