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

# Generate an embedding vector

> Generates an embedding vector for the provided text using the configured embedding provider (default: Google Gemini). Used by publishing services to embed entity text before indexing, and by the global search endpoint to vectorise natural language queries.



## OpenAPI

````yaml /openapi/em-runtime-search-v2.yaml post /search/embeddings
openapi: 3.1.0
info:
  title: em_runtime_search
  version: 5.27.0
servers: []
security: []
paths:
  /search/embeddings:
    post:
      tags:
        - embeddings
      summary: Generate an embedding vector
      description: >-
        Generates an embedding vector for the provided text using the configured
        embedding provider (default: Google Gemini). Used by publishing services
        to embed entity text before indexing, and by the global search endpoint
        to vectorise natural language queries.
      operationId: create_embedding
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbedRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbedResponse'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    EmbedRequest:
      properties:
        text:
          type: string
          minLength: 1
          title: Text
          description: Text to embed
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Model override. Uses the server-configured default if omitted.
          examples:
            - gemini-embedding-001
      type: object
      required:
        - text
      title: EmbedRequest
      description: Request body for POST /utils/embeddings.
    EmbedResponse:
      properties:
        embedding:
          items:
            type: number
          type: array
          title: Embedding
          description: Embedding vector
        model:
          type: string
          title: Model
          description: Model used to generate the embedding
        dimensions:
          type: integer
          title: Dimensions
          description: Number of dimensions in the embedding vector
      type: object
      required:
        - embedding
        - model
        - dimensions
      title: EmbedResponse
      description: Response from POST /utils/embeddings.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
      description: Standard error response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        details:
          additionalProperties: true
          type: object
          title: Details
        request_id:
          type: string
          title: Request Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
      type: object
      required:
        - code
        - message
        - request_id
        - timestamp
      title: ErrorBody
      description: Error body with structured details.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - INVALID_TOKEN
        - INSUFFICIENT_PERMISSIONS
        - RESOURCE_NOT_FOUND
        - RESOURCE_ALREADY_EXISTS
        - VALIDATION_ERROR
        - RATE_LIMIT_EXCEEDED
        - SERVICE_UNAVAILABLE
        - INTERNAL_ERROR
      title: ErrorCode
      description: Standard error codes for API responses.

````