Read an asset's lineage
curl --request GET \
--url https://api.zerogen.com/v1/assets/{assetId}/lineage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets/{assetId}/lineage', 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}/lineage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"asset": {
"assetId": "<string>",
"depth": 4503599627370495,
"found": true,
"deleted": true,
"name": "<string>",
"origin": "<string>",
"mimeType": "<string>",
"runId": "<string>",
"prompt": "<string>",
"moreUses": 4503599627370495
},
"sources": [
{
"assetId": "<string>",
"depth": 4503599627370495,
"found": true,
"deleted": true,
"name": "<string>",
"origin": "<string>",
"mimeType": "<string>",
"runId": "<string>",
"prompt": "<string>",
"moreUses": 4503599627370495
}
],
"uses": [
{
"assetId": "<string>",
"depth": 4503599627370495,
"found": true,
"deleted": true,
"name": "<string>",
"origin": "<string>",
"mimeType": "<string>",
"runId": "<string>",
"prompt": "<string>",
"moreUses": 4503599627370495
}
],
"edges": [
{
"assetId": "<string>",
"sourceAssetId": "<string>",
"role": "<string>",
"kind": "<string>"
}
],
"truncated": {
"sources": true,
"uses": 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's lineage
What the asset was made from, in any project, and what was made from it, in its project: up to 30 assets on each side, nearest first. An edge reads assetId was made from sourceAssetId.
Needs the library:read scope.
GET
/
assets
/
{assetId}
/
lineage
Read an asset's lineage
curl --request GET \
--url https://api.zerogen.com/v1/assets/{assetId}/lineage \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zerogen.com/v1/assets/{assetId}/lineage', 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}/lineage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"asset": {
"assetId": "<string>",
"depth": 4503599627370495,
"found": true,
"deleted": true,
"name": "<string>",
"origin": "<string>",
"mimeType": "<string>",
"runId": "<string>",
"prompt": "<string>",
"moreUses": 4503599627370495
},
"sources": [
{
"assetId": "<string>",
"depth": 4503599627370495,
"found": true,
"deleted": true,
"name": "<string>",
"origin": "<string>",
"mimeType": "<string>",
"runId": "<string>",
"prompt": "<string>",
"moreUses": 4503599627370495
}
],
"uses": [
{
"assetId": "<string>",
"depth": 4503599627370495,
"found": true,
"deleted": true,
"name": "<string>",
"origin": "<string>",
"mimeType": "<string>",
"runId": "<string>",
"prompt": "<string>",
"moreUses": 4503599627370495
}
],
"edges": [
{
"assetId": "<string>",
"sourceAssetId": "<string>",
"role": "<string>",
"kind": "<string>"
}
],
"truncated": {
"sources": true,
"uses": 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