> ## 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.

# OpenAI Format - Embeddings

> - Generic Embeddings API reference for all OpenAI-compatible embedding models
- Convert text to vector representations
- Supports single or batch input
- Configurable output dimensions and encoding format




## OpenAPI

````yaml openapi/en/openai-format-embeddings.json POST /v1/embeddings
openapi: 3.1.0
info:
  title: OpenAI Format - Embeddings
  version: '1.0'
servers:
  - url: https://api.aihubmax.com
security:
  - BearerAuth: []
paths:
  /v1/embeddings:
    post:
      tags:
        - Text Series > OpenAI Format
      summary: OpenAI Format - Embeddings
      description: >
        - Generic Embeddings API reference for all OpenAI-compatible embedding
        models

        - Convert text to vector representations

        - Supports single or batch input

        - Configurable output dimensions and encoding format
      operationId: openai-format-embeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
            examples:
              single-text:
                summary: Single Text
                description: Convert a single text to vector
                value:
                  model: text-embedding-3-small
                  input: Machine learning is a branch of artificial intelligence
              batch-texts:
                summary: Batch Texts
                description: >-
                  Convert multiple texts to vectors in batch, suitable for
                  building knowledge base indexes
                value:
                  model: text-embedding-3-small
                  input:
                    - How to reset my password?
                    - How long does a refund take?
                    - How to contact customer support?
                    - What is the delivery time?
              custom-dimensions:
                summary: Custom Dimensions
                description: Specify output dimensions to reduce storage
                value:
                  model: text-embedding-3-small
                  input: >-
                    The training process of deep learning models includes
                    forward propagation and back propagation
                  dimensions: 256
      responses:
        '200':
          $ref: '#/components/responses/EmbeddingSuccess'
        '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:
    EmbeddingRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: Embedding model name
          example: text-embedding-3-small
        input:
          description: Input text to embed, encoded as a string or array of strings
          oneOf:
            - type: string
              description: A single text string to embed
            - type: array
              description: An array of text strings to embed in a single request
              items:
                type: string
        encoding_format:
          type: string
          description: The format to return the embeddings in
          enum:
            - float
            - base64
          default: float
        dimensions:
          type: integer
          description: >-
            The number of dimensions the resulting output embeddings should
            have. Only supported in some models.
    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
          description: Object type
          enum:
            - list
        data:
          type: array
          description: List of embedding objects
          items:
            type: object
            properties:
              object:
                type: string
                description: Object type
                enum:
                  - embedding
              index:
                type: integer
                description: The index of the embedding in the list of embeddings
                example: 0
              embedding:
                type: array
                description: The embedding vector
                items:
                  type: number
                example:
                  - 0.0023064255
                  - -0.009327292
                  - 0.015797347
        model:
          type: string
          description: Model used
        usage:
          type: object
          description: Token usage statistics
          properties:
            prompt_tokens:
              type: integer
              description: Number of tokens in the input
              example: 8
            total_tokens:
              type: integer
              description: Total number of tokens used
              example: 8
    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:
    EmbeddingSuccess:
      description: Embedding response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EmbeddingResponse'
    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 APIs require Bearer Token authentication ##

        Add to request header:

        `Authorization: Bearer YOUR_API_KEY`

````