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

# Search Library images

> Find Brand Library images by what they depict, such as product photos or packaging. Generated images are excluded.



## OpenAPI

````yaml https://www.rainbrand.com/api/v1/spec.json post /images/search
openapi: 3.1.1
info:
  title: Rainbrand API
  version: 1.0.0
servers:
  - url: https://www.rainbrand.com/api/v1
security:
  - apiKey: []
  - bearer: []
  - oauth: []
tags:
  - name: Feedback
    description: Report problems and observations about Rainbrand.
  - name: Uploads
    description: >-
      Stage private local files for brand sources, the Library, and other
      supported operations.
  - name: Account
    description: Check the connected account, accessible teams, and credit balances.
  - name: Brands
    description: Manage brands and brand identity.
  - name: Library
    description: Add, list, and remove a brand's images, video, and audio.
  - name: Images
    description: Retrieve and manage images.
  - name: Videos
    description: Retrieve and manage video files.
  - name: Audio
    description: Retrieve and manage audio files.
  - name: Briefs
    description: Get brand guidance and selected assets for a specific task.
  - name: Models
    description: Find available models and check their inputs.
  - name: Generations
    description: Create and retrieve model generations.
  - name: Reviews
    description: >-
      Check an asset against a brand's color, typography, logo, and copy
      guidance.
paths:
  /images/search:
    post:
      tags:
        - Images
      summary: Search Library images
      description: >-
        Find Brand Library images by what they depict, such as product photos or
        packaging. Generated images are excluded.
      operationId: images.search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                brandSessionId:
                  type: string
                  format: uuid
                  description: Brand ID to search within
                query:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Visual concept to search for. Plain noun phrases work best —
                    e.g., 'drone in flight', 'team working at desks', 'product
                    on white background'.
                limit:
                  type: integer
                  minimum: 1
                  maximum: 50
                  default: 10
                  description: Max results to return (default 10, max 50)
                cursor:
                  type: string
                  description: Pagination cursor from a previous response's nextCursor
                maxDistance:
                  type: number
                  minimum: 0
                  maximum: 2
                  default: 0.7
                  description: >-
                    Cosine-distance cutoff (smaller = stricter). The default of
                    0.7 works well for most queries. Use a higher value for
                    broader matching or a lower value for stricter results.
                    Distances above this threshold are excluded.
              required:
                - brandSessionId
                - query
              examples:
                - brandSessionId: e6220a5e-4a68-4d39-8bb9-5105e9a3a164
                  query: Atlas Pro product packaging on a white background
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      query:
                        type: string
                      candidates:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                            url:
                              type: string
                            description:
                              type: string
                            width:
                              anyOf:
                                - type: number
                                - type: 'null'
                            height:
                              anyOf:
                                - type: number
                                - type: 'null'
                            aspectRatio:
                              anyOf:
                                - enum:
                                    - '1:1'
                                    - '2:3'
                                    - '3:2'
                                    - '3:4'
                                    - '4:3'
                                    - '4:5'
                                    - '5:4'
                                    - '9:16'
                                    - '16:9'
                                    - '21:9'
                                  type: string
                                - type: 'null'
                            distance:
                              type: number
                              description: Opaque relevance score; smaller = closer.
                          required:
                            - id
                            - url
                            - description
                            - width
                            - height
                            - aspectRatio
                            - distance
                      nextCursor:
                        anyOf:
                          - type: string
                          - type: 'null'
                      hasMore:
                        type: boolean
                    required:
                      - query
                      - candidates
                      - nextCursor
                      - hasMore
                required:
                  - data
              example:
                data:
                  query: Atlas Pro product packaging on a white background
                  candidates:
                    - id: a8dd463a-09ab-4307-93e5-6e4cecd61ffd
                      url: >-
                        https://www.rainbrand.com/img/a8dd463a-09ab-4307-93e5-6e4cecd61ffd
                      description: Atlas Pro packaging on white.
                      width: 1536
                      height: 1024
                      aspectRatio: '3:2'
                      distance: 0.24
                  nextCursor: null
                  hasMore: false
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesSearch400ErrorResponse'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesSearch401ErrorResponse'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesSearch403ErrorResponse'
        '422':
          description: '422'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesSearch422ErrorResponse'
        '429':
          description: '429'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesSearch429ErrorResponse'
          headers:
            Retry-After:
              description: >-
                Seconds until the applicable request or operation limit resets.
                Present when the limiter can calculate the delay.
              schema:
                type: integer
                minimum: 0
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://www.rainbrand.com/api/v1/images/search' \
              --header "x-api-key: $RAINBRAND_API_KEY" \
              --header "Content-Type: application/json" \
              --data '{
              "brandSessionId": "e6220a5e-4a68-4d39-8bb9-5105e9a3a164",
              "query": "Atlas Pro product packaging on a white background"
            }'
components:
  schemas:
    ImagesSearch400ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: INVALID_CURSOR
                    status:
                      const: 400
                    message:
                      type: string
                      default: Invalid pagination cursor
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesSearch401ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: UNAUTHORIZED
                    status:
                      const: 401
                    message:
                      type: string
                      default: Invalid or missing API credentials
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesSearch403ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: ACCOUNT_BANNED
                    status:
                      const: 403
                    message:
                      type: string
                      default: This account has been suspended.
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: FORBIDDEN
                    status:
                      const: 403
                    message:
                      type: string
                      default: Plan upgrade required
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: FEATURE_NOT_AVAILABLE
                    status:
                      const: 403
                    message:
                      type: string
                      default: This operation isn't available for this integration.
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesSearch422ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: BRAND_NOT_FOUND
                    status:
                      const: 422
                    message:
                      type: string
                      default: Brand session not found
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesSearch429ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: TOO_MANY_REQUESTS
                    status:
                      const: 429
                    message:
                      type: string
                      default: Rate limit exceeded
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ApiError:
      type: object
      properties:
        code:
          type: string
        status:
          type: integer
        message:
          type: string
        data: {}
      required:
        - code
        - status
        - message
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Rainbrand API key, for example `x-api-key: bloom_sk_...`.'
    bearer:
      type: http
      scheme: bearer
      description: >-
        Rainbrand API key (`Bearer bloom_sk_...`) or Rainbrand OAuth access
        token.
    oauth:
      type: oauth2
      description: >-
        Authorization Code with PKCE S256. See
        [Authentication](https://docs.rainbrand.com/api/authentication).
      flows:
        authorizationCode:
          authorizationUrl: https://www.rainbrand.com/api/auth/oauth2/authorize
          tokenUrl: https://www.rainbrand.com/api/auth/oauth2/token
          scopes:
            openid: Authenticate the user's identity with OpenID Connect.
            offline_access: Request a refresh token for access when the user is offline.

````

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