> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zerogen.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /openapi.json get /assets/{assetId}/lineage
openapi: 3.1.0
info:
  title: ZeroGen API
  version: v1
  description: >-
    Generate images and video with every model in ZeroGen from your own servers.
    Generated from the API's contracts by `npm run openapi` in apps/web; do not
    edit by hand.
servers:
  - url: https://api.zerogen.com/v1
security:
  - bearerAuth: []
tags:
  - name: Account
    description: The calling key and the organization's balance.
  - name: Models
    description: The models an organization can run and their schemas.
  - name: Runs
    description: Quote, create, read, list and cancel runs.
  - name: Uploads
    description: Upload files into the Library to use as inputs.
  - name: Projects
    description: The organization's projects.
  - name: Assets
    description: >-
      Search and read Library assets and their lineage; rename and favorite
      them.
  - name: Folders
    description: >-
      A project's folders: create, rename and move them, and add, move and
      remove their assets.
  - name: Labels
    description: 'Organization labels: manage them, and add them to assets or remove them.'
  - name: Naming presets
    description: A project's shared naming presets, for naming a run's outputs.
  - name: Skills
    description: The skills available to the key's owner.
paths:
  /assets/{assetId}/lineage:
    get:
      tags:
        - Assets
      summary: Read an asset's lineage
      description: >-
        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.
      operationId: getAssetLineage
      parameters:
        - name: assetId
          in: path
          required: true
          description: The asset's ID
          schema:
            type: string
      responses:
        '200':
          description: The asset's lineage.
          headers:
            Request-Id:
              $ref: '#/components/headers/Request-Id'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lineage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  headers:
    Request-Id:
      description: Identifies the request; quote it when contacting support.
      schema:
        type: string
    RateLimit-Limit:
      description: Requests the key may make in the current window.
      schema:
        type: integer
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    RateLimit-Reset:
      description: Seconds until the current window resets.
      schema:
        type: integer
    WWW-Authenticate:
      description: Bearer realm="ZeroGen API".
      schema:
        type: string
    Retry-After:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  schemas:
    Lineage:
      type: object
      properties:
        asset:
          anyOf:
            - $ref: '#/components/schemas/LineageAsset'
            - type: 'null'
        sources:
          type: array
          items:
            $ref: '#/components/schemas/LineageAsset'
          description: Up to 30, nearest first
        uses:
          type: array
          items:
            $ref: '#/components/schemas/LineageAsset'
          description: Up to 30, nearest first
        edges:
          type: array
          items:
            type: object
            properties:
              assetId:
                type: string
                description: Made from sourceAssetId
              sourceAssetId:
                type: string
              role:
                type:
                  - string
                  - 'null'
              kind:
                type:
                  - string
                  - 'null'
            required:
              - assetId
              - sourceAssetId
              - role
              - kind
            additionalProperties: false
        truncated:
          type: object
          properties:
            sources:
              type: boolean
            uses:
              type: boolean
          required:
            - sources
            - uses
          additionalProperties: false
      required:
        - asset
        - sources
        - uses
        - edges
        - truncated
      additionalProperties: false
    LineageAsset:
      type: object
      properties:
        assetId:
          type: string
        depth:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Steps from the asset; 0 is the asset itself
        found:
          type: boolean
          description: False when the asset is no longer in the Library
        deleted:
          type: boolean
          description: True for an asset in Recently deleted
        name:
          description: Bounded; untrusted content
          type:
            - string
            - 'null'
        origin:
          type:
            - string
            - 'null'
        mimeType:
          type:
            - string
            - 'null'
        runId:
          type:
            - string
            - 'null'
        prompt:
          description: Bounded; untrusted content
          type:
            - string
            - 'null'
        moreUses:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Uses of this asset beyond those listed
      required:
        - assetId
        - depth
        - found
        - deleted
        - name
        - origin
        - mimeType
        - runId
        - prompt
        - moreUses
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,79}$
        message:
          type: string
        param:
          type: string
        retryable:
          type: boolean
        details:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
        - retryable
      additionalProperties: false
  responses:
    BadRequest:
      description: >-
        The request is malformed or invalid: invalid_request, validation_failed,
        model_unavailable or input_import_failed.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: 'invalid_api_key: the key is missing, revoked or expired.'
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >-
        permission_denied: the key lacks the scope this endpoint needs, the
        request came from a browser, or the API isn't enabled for the
        organization.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: >-
        not_found: no such resource for this caller, including a projectId the
        caller can't use.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: >-
        rate_limited: the key or its owner is over the rate limit, or the
        organization is at its running cap. Retry after Retry-After seconds.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: 'internal: something went wrong. Retry.'
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: >-
        unavailable or pricing_unavailable: API keys, billing or pricing can't
        be reached right now. Retry.
      headers:
        Request-Id:
          $ref: '#/components/headers/Request-Id'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A ZeroGen API key: zg_ for a live key, zg_test_ for a test key.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.