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

# Embeddings

> Generate vector embeddings for text

`input` accepts a string or an array of strings (batch in one request).


## OpenAPI

````yaml POST /embeddings
openapi: 3.0.1
info:
  title: Electron Hub API
  description: >-
    Unified API platform integrating 200+ AI models for chat, image generation,
    speech-to-text, embeddings, and more.
  version: 1.0.0
  contact:
    name: Electron Hub Support
    email: support@electronhub.ai
    url: https://discord.com/invite/electronhub
  license:
    name: MIT
servers:
  - url: https://api.electronhub.ai/v1
    description: Production API v1
security:
  - bearerAuth: []
paths:
  /embeddings:
    post:
      summary: Create Embeddings
      description: Create text embeddings
      operationId: createEmbeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
components:
  schemas:
    EmbeddingRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          example: text-embedding-ada-002
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          description: Input text to embed
        encoding_format:
          type: string
          enum:
            - float
            - base64
          default: float
        dimensions:
          type: integer
          description: Number of dimensions for the embedding
    EmbeddingResponse:
      type: object
      required:
        - object
        - data
        - model
        - usage
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/EmbeddingData'
        model:
          type: string
        usage:
          $ref: '#/components/schemas/EmbeddingUsage'
    EmbeddingData:
      type: object
      required:
        - object
        - embedding
        - index
      properties:
        object:
          type: string
          example: embedding
        embedding:
          type: array
          items:
            type: number
        index:
          type: integer
    EmbeddingUsage:
      type: object
      required:
        - prompt_tokens
        - total_tokens
      properties:
        prompt_tokens:
          type: integer
        total_tokens:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your API key (starts with 'ek-')

````