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

# Gemini Format - Embeddings

> - Compatible with all Gemini native format embedding APIs
- Converts text into high-dimensional vector representations
- Supports multiple task types: retrieval, classification, clustering, semantic similarity, etc.
- Supports custom output dimensionality (dimensionality reduction)




## OpenAPI

````yaml openapi/en/gemini-format-embeddings.json POST /v1beta/models/{model}:embedContent
openapi: 3.1.0
info:
  title: Gemini Format - Embeddings
  version: '1.0'
servers:
  - url: https://api.aihubmax.com
security:
  - BearerAuth: []
paths:
  /v1beta/models/{model}:embedContent:
    post:
      tags:
        - Text Series > Gemini Format
      summary: Gemini Format - Embeddings
      description: >
        - Compatible with all Gemini native format embedding APIs

        - Converts text into high-dimensional vector representations

        - Supports multiple task types: retrieval, classification, clustering,
        semantic similarity, etc.

        - Supports custom output dimensionality (dimensionality reduction)
      operationId: gemini-format-embed-content
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
            example: gemini-embedding-2-preview
          description: Embedding model name, e.g. gemini-embedding-2-preview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbedContentRequest'
            examples:
              simple:
                summary: Single text embedding
                description: The most basic single text embedding request
                value:
                  content:
                    parts:
                      - text: What is deep learning?
              with-task-type:
                summary: Specify task type and output dimensions
                description: >-
                  Use taskType and outputDimensionality to control embedding
                  behavior
                value:
                  content:
                    parts:
                      - text: How do Transformer models handle long sequences?
                  taskType: RETRIEVAL_QUERY
                  outputDimensionality: 768
              retrieval-document:
                summary: Document retrieval embedding
                description: Document embedding for retrieval, with title parameter
                value:
                  content:
                    parts:
                      - text: >-
                          Deep learning is a subfield of machine learning that
                          learns complex patterns and representations from data
                          through multi-layer neural networks. It has achieved
                          breakthroughs in areas such as image recognition,
                          natural language processing, and speech recognition.
                  taskType: RETRIEVAL_DOCUMENT
                  title: Overview of Deep Learning
      responses:
        '200':
          $ref: '#/components/responses/EmbedContentSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    EmbedContentRequest:
      type: object
      required:
        - content
      properties:
        content:
          type: object
          description: The content to embed
          required:
            - parts
          properties:
            parts:
              type: array
              description: >-
                List of content parts. `gemini-embedding-2-preview` supports
                multimodal input (image/audio/video/PDF); older models support
                text only
              items:
                type: object
                properties:
                  text:
                    type: string
                    description: Text content to embed
                  inlineData:
                    type: object
                    description: >-
                      Inline binary data (base64 encoded). Only supported by
                      `gemini-embedding-2-preview`. Supports images (up to 6),
                      audio (up to 80s), video (up to 120s), PDF (up to 6
                      pages).
                    required:
                      - mimeType
                      - data
                    properties:
                      mimeType:
                        type: string
                        description: IANA standard MIME type
                        examples:
                          - image/png
                          - image/jpeg
                          - audio/mp3
                          - audio/wav
                          - video/mp4
                          - video/quicktime
                          - application/pdf
                      data:
                        type: string
                        description: Base64 encoded binary data
        taskType:
          type: string
          description: >-
            Embedding task type, which affects the optimization direction of the
            embedding vector. **Note**: `gemini-embedding-2-preview` does not
            support this field; that model uses a prompt prefix approach to
            specify task types (e.g. `task: search result | query: {content}`)
          enum:
            - RETRIEVAL_QUERY
            - RETRIEVAL_DOCUMENT
            - SEMANTIC_SIMILARITY
            - CLASSIFICATION
            - CLUSTERING
            - QUESTION_ANSWERING
            - FACT_VERIFICATION
            - CODE_RETRIEVAL_QUERY
        title:
          type: string
          description: Document title, only effective when taskType is RETRIEVAL_DOCUMENT
        outputDimensionality:
          type: integer
          description: >-
            Output vector dimensionality, used for dimensionality reduction.
            Default 3072
    EmbedContentResponse:
      type: object
      properties:
        embedding:
          type: object
          description: Embedding result
          properties:
            values:
              type: array
              description: Embedding vector values
              items:
                type: number
              example:
                - 0.0123
                - -0.0456
                - 0.0789
                - 0.0234
                - -0.0567
    ErrorResponse400:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
    ErrorResponse401:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Invalid API Key
            type:
              type: string
              example: authentication_error
    ErrorResponse403:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Access denied
            type:
              type: string
              example: permission_error
    ErrorResponse429:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Rate limit exceeded
            type:
              type: string
              example: rate_limit_error
    ErrorResponse500:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Internal server error
            type:
              type: string
              example: server_error
  responses:
    EmbedContentSuccess:
      description: Embedding response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EmbedContentResponse'
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse401'
    PaymentRequired:
      description: Insufficient balance
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse400'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse403'
    TooManyRequests:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse429'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse500'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        ## All endpoints require Bearer Token authentication ##

        Add the following to your request headers:

        `Authorization: Bearer YOUR_API_KEY`

````