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

# Search the asset library

> Full-text search, ranked, with ties going to prepared assets. One hit per group of alternatives unless group=false. `unapplied` lists filters that weren't used and why; with few hits, `relax` says what to drop.



## OpenAPI

````yaml /api-reference/openapi.json get /assets/search
openapi: 3.1.0
info:
  title: Patch API
  version: 1.0.0
  description: >-
    The public API behind patch.gg, the desktop app and pch. Changes within v1
    are additive only. Errors are { error: { code, message, details } }; branch
    on code.
servers:
  - url: https://patch.gg/api/v1
security: []
paths:
  /assets/search:
    get:
      tags:
        - Assets
      summary: Search the asset library
      description: >-
        Full-text search, ranked, with ties going to prepared assets. One hit
        per group of alternatives unless group=false. `unapplied` lists filters
        that weren't used and why; with few hits, `relax` says what to drop.
      parameters:
        - schema:
            type: string
            maxLength: 200
            description: Text to search for
            example: crate
          required: false
          description: Text to search for
          name: q
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: Asset types (repeat or comma-separate)
            example: model
          required: false
          description: Asset types (repeat or comma-separate)
          name: type
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: Source ids or names, e.g. polyhaven
          required: false
          description: Source ids or names, e.g. polyhaven
          name: source
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: SPDX ids, or "safe" (every license in the registry; the default)
          required: false
          description: SPDX ids, or "safe" (every license in the registry; the default)
          name: license
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              Capabilities the asset must keep on the runtime, e.g. collision (a
              higher one counts)
          required: false
          description: >-
            Capabilities the asset must keep on the runtime, e.g. collision (a
            higher one counts)
          name: cap
          in: query
        - schema:
            type: string
            description: Runtime the capabilities and variants are for
            example: patch-web@1
          required: false
          description: Runtime the capabilities and variants are for
          name: runtime
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: indexed, converting, ready or failed (failed is hidden by default)
          required: false
          description: indexed, converting, ready or failed (failed is hidden by default)
          name: prep
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: >-
              Filters on facets, field<op>value: "triangles<=5000", "texture_px
              between 512,2048", "cap has collision". Repeat for several.
          required: false
          description: >-
            Filters on facets, field<op>value: "triangles<=5000", "texture_px
            between 512,2048", "cap has collision". Repeat for several.
          name: where
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Only AI-generated, or none
          required: false
          description: Only AI-generated, or none
          name: ai
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: One hit per group (default true)
          required: false
          description: One hit per group (default true)
          name: group
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          required: false
          name: limit
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
      responses:
        '200':
          description: Hits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AssetSearch'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not signed in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AssetSearch:
      type: object
      properties:
        total:
          type: number
        hits:
          type: array
          items:
            $ref: '#/components/schemas/AssetHit'
        interpreted:
          type: object
          properties:
            q:
              type: string
            runtime:
              type: string
            types:
              type: array
              items:
                type: string
            filters:
              type: array
              items:
                type: object
                properties:
                  f:
                    type: string
                  op:
                    type: string
                    enum:
                      - '='
                      - '!='
                      - <
                      - <=
                      - '>'
                      - '>='
                      - in
                      - has
                      - between
                  v:
                    anyOf:
                      - type: string
                      - type: number
                      - type: boolean
                      - type: array
                        items:
                          anyOf:
                            - type: string
                            - type: number
                required:
                  - f
                  - op
                  - v
            license:
              type: array
              items:
                type: string
            cap:
              type: array
              items:
                type: string
          required:
            - q
            - runtime
            - types
            - filters
            - license
            - cap
        unapplied:
          type: array
          items:
            type: string
        relax:
          type: array
          items:
            type: object
            properties:
              drop:
                type: string
              adds:
                type: number
              why:
                type: string
            required:
              - drop
              - adds
        next_cursor:
          type:
            - string
            - 'null'
        untrusted_fields:
          type: array
          items:
            type: string
      required:
        - total
        - hits
        - interpreted
        - unapplied
        - relax
        - next_cursor
        - untrusted_fields
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: version_exists
            message:
              type: string
            details: {}
          required:
            - code
            - message
      required:
        - error
    AssetHit:
      type: object
      properties:
        id:
          type: string
          example: polyhaven:wooden_crate_02
        type:
          type: string
        title:
          type: string
        title_by:
          type: string
          enum:
            - upstream
            - patch
        source:
          type: string
        source_id:
          type: string
        license:
          type: string
        ai:
          type: boolean
        thumbnail_url:
          type:
            - string
            - 'null'
        prep:
          type: object
          properties:
            state:
              type: string
              enum:
                - indexed
                - converting
                - ready
                - failed
            eta_s:
              type: number
            error:
              type: string
          required:
            - state
        fit:
          type: object
          properties:
            variant:
              type:
                - string
                - 'null'
            mb:
              type: number
            est:
              type: boolean
          required:
            - variant
          additionalProperties: {}
          description: >-
            What the hit costs with the variant auto picks; any number facet of
            the type (triangles, dims_m, …) by key
        capabilities:
          type: object
          properties:
            runtime:
              type: string
            keeps:
              type: array
              items:
                type: string
            dropped:
              type: array
              items:
                type: object
                properties:
                  capability:
                    type: string
                  reason:
                    type: string
                required:
                  - capability
                  - reason
          required:
            - runtime
            - keeps
            - dropped
        traits:
          type: array
          items:
            type: string
        group:
          type: object
          properties:
            key:
              type: string
            alternatives:
              type: number
          required:
            - key
            - alternatives
        warn:
          type: array
          items:
            type: string
      required:
        - id
        - type
        - title
        - title_by
        - source
        - source_id
        - license
        - ai
        - thumbnail_url
        - prep
        - fit
        - capabilities
        - traits

````

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