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

# Search Cast avatars and backgrounds



## OpenAPI

````yaml /api/openapi.json post /api/v1/cast/library/search
openapi: 3.0.2
info:
  title: Melius API
  version: '1'
  description: >-
    The Melius REST API. Authenticate with an API key as a bearer token
    (`Authorization: Bearer mel_...`) and select the team to act on with the
    `x-team-id` header. Generations run through the same node + run pipeline as
    the app: create a node on a canvas, start a run, poll the run, then read the
    resulting version asset.
servers:
  - url: https://api.melius.com
security:
  - apiKey: []
    teamId: []
paths:
  /api/v1/cast/library/search:
    post:
      tags:
        - cast
      summary: Search Cast avatars and backgrounds
      operationId: cast.library
      parameters: []
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type: object
              properties:
                pageSize:
                  type: integer
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 100
                  default: 50
                cursor:
                  type: string
                  minLength: 1
                  maxLength: 4096
                includeCount:
                  type: boolean
                  default: false
                kind:
                  type: string
                  enum:
                    - avatar
                    - background
                roster:
                  type: string
                  enum:
                    - all
                    - custom
                    - melius
                  default: all
              required:
                - kind
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - avatar
                            avatar:
                              type: object
                              properties:
                                kind:
                                  type: string
                                  enum:
                                    - custom
                                    - curated
                                    - element
                                id:
                                  type: string
                                  format: uuid
                              required:
                                - kind
                                - id
                              additionalProperties: false
                            name:
                              type: string
                            imageUrl:
                              type: string
                              nullable: true
                            previewUrl:
                              type: string
                              nullable: true
                          required:
                            - kind
                            - avatar
                            - name
                            - imageUrl
                            - previewUrl
                        - type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - background
                            backgroundId:
                              type: string
                              format: uuid
                            name:
                              type: string
                            previewUrl:
                              type: string
                              nullable: true
                            prompt:
                              type: string
                          required:
                            - kind
                            - backgroundId
                            - name
                            - previewUrl
                            - prompt
                  pageSize:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  count:
                    type: integer
                    nullable: true
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  hasMore:
                    type: boolean
                  nextCursor:
                    type: string
                    nullable: true
                    minLength: 1
                    maxLength: 4096
                required:
                  - data
                  - pageSize
                  - count
                  - hasMore
                  - nextCursor
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '401':
          description: Missing, invalid, expired, or revoked API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - statusCode
                  - message
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
        '429':
          description: Rate limit reached — retry after the `Retry-After` header.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                  error:
                    type: string
                  message:
                    type: string
                  retryAfterSeconds:
                    type: integer
                required:
                  - statusCode
                  - message
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: 'A Melius API key (`mel_...`), sent as `Authorization: Bearer <key>`.'
    teamId:
      type: apiKey
      in: header
      name: x-team-id
      description: The team (workspace) to act on. Defaults to the key's team when omitted.

````

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