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

# Semantic Search

> Semantic search (powered by vector embeddings) over the brand session's library images, ranked nearest-first. Library images are those whose `source` is `uploaded` (added by the user) or `scraped` (pulled in during onboarding) — generated images are excluded. Pass `cursor` from the previous response to paginate.



## OpenAPI

````yaml https://www.trybloom.ai/api/v1/spec.json post /images/search
openapi: 3.1.1
info:
  title: Bloom API
  version: 1.0.0
servers:
  - url: https://www.trybloom.ai/api/v1
security:
  - apiKey: []
  - bearer: []
tags:
  - name: Account
    description: >-
      Inspect the authenticated account — profile, credit balance, and
      accessible workspaces.
  - name: Brands
    description: Manage brands and brand identity.
  - name: Images
    description: Generate, edit, and retrieve images.
paths:
  /images/search:
    post:
      tags:
        - Images
      summary: Semantic Search
      description: >-
        Semantic search (powered by vector embeddings) over the brand session's
        library images, ranked nearest-first. Library images are those whose
        `source` is `uploaded` (added by the user) or `scraped` (pulled in
        during onboarding) — generated images are excluded. Pass `cursor` from
        the previous response to paginate.
      operationId: images.search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                brandSessionId:
                  type: string
                  format: uuid
                  description: Brand session UUID 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). Default 0.7
                    gives good relevance for most queries; loosen for long-tail
                    matches, tighten for stricter recall. Distances above this
                    threshold are dropped.
              required:
                - brandSessionId
                - query
      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: '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
        '400':
          description: '400'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: INVALID_CURSOR
                      status:
                        const: 400
                      message:
                        type: string
                        default: Invalid pagination cursor
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '401':
          description: '401'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: UNAUTHORIZED
                      status:
                        const: 401
                      message:
                        type: string
                        default: Invalid or missing API credentials
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '403':
          description: '403'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: FORBIDDEN
                      status:
                        const: 403
                      message:
                        type: string
                        default: Plan upgrade required
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '422':
          description: '422'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: BRAND_NOT_FOUND
                      status:
                        const: 422
                      message:
                        type: string
                        default: Brand session not found
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '429':
          description: '429'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: TOO_MANY_REQUESTS
                      status:
                        const: 429
                      message:
                        type: string
                        default: Rate limit exceeded
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Bloom API key, for example `x-api-key: bloom_sk_...`.'
    bearer:
      type: http
      scheme: bearer
      description: Bloom API key (`Bearer bloom_sk_...`) or Bloom OAuth access token.

````