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

# Create Embeddings

> OpenAI-compatible embeddings endpoint.



## OpenAPI

````yaml /api-reference/v3-openapi.json post /v3/embeddings
openapi: 3.1.0
info:
  title: Eden AI API V3
  version: 3.0.0
servers:
  - url: https://api.edenai.run
    description: Production server
security: []
paths:
  /v3/embeddings:
    post:
      tags:
        - Embeddings
      summary: Create Embeddings
      description: OpenAI-compatible embeddings endpoint.
      operationId: create_embeddings_v3_embeddings_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingsBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - AuthBearer: []
components:
  schemas:
    EmbeddingsBody:
      properties:
        input:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
            - items:
                type: integer
              type: array
            - items:
                items:
                  type: integer
                type: array
              type: array
          title: Input
          description: >-
            Input to embed: string, list of strings, pre-tokenized list of ints,
            or pre-tokenized batch (list of int lists). Max 2048 items for
            OpenAI.
        model:
          type: string
          title: Model
          description: >-
            Model identifier in 'provider/model' format, e.g.
            'openai/text-embedding-3-small'.
        encoding_format:
          anyOf:
            - type: string
              enum:
                - float
                - base64
            - type: 'null'
          title: Encoding Format
          description: 'Output encoding: ''float'' (default) or ''base64''.'
          default: float
        dimensions:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Dimensions
          description: Reduce output vector size. 3-series models only.
        user:
          anyOf:
            - type: string
            - type: 'null'
          title: User
          description: End-user identifier for abuse tracking.
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Arbitrary metadata attached to the request.
        extra_headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Extra Headers
          description: Additional HTTP headers forwarded to the provider API.
      additionalProperties: true
      type: object
      required:
        - input
        - model
      title: EmbeddingsBody
      description: >-
        OpenAI-compatible `POST /v1/embeddings` request body, plus minimal Eden
        extensions.


        Unknown top-level fields are forwarded to the underlying provider.
    EmbeddingsResponse:
      properties:
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        data:
          items:
            $ref: '#/components/schemas/EmbeddingItem'
          type: array
          title: Data
        model:
          type: string
          title: Model
        object:
          type: string
          const: list
          title: Object
        usage:
          $ref: '#/components/schemas/Usage'
      additionalProperties: true
      type: object
      required:
        - data
        - model
        - object
        - usage
      title: EmbeddingsResponse
      description: >-
        OpenAI-compatible embeddings response + Eden `cost` and `provider`
        fields.


        `EmbeddingsDataClass` (from edenai-apis) already widens

        ``data[].embedding`` to ``list[float] | str`` so the base64 wire format

        validates here too.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EmbeddingItem:
      properties:
        embedding:
          anyOf:
            - items:
                type: number
              type: array
            - type: string
          title: Embedding
        index:
          type: integer
          title: Index
        object:
          type: string
          const: embedding
          title: Object
      additionalProperties: true
      type: object
      required:
        - embedding
        - index
        - object
      title: EmbeddingItem
      description: >-
        OpenAI embedding item with the wire-format quirk made explicit.


        The OpenAI SDK types ``embedding`` as ``list[float]`` only because the
        SDK

        transparently decodes base64 before populating the model. The actual API

        *wire* response returns a base64 string when
        ``encoding_format='base64'``.

        Eden is a passthrough for OpenAI-compatible callers who explicitly want
        the

        smaller base64 payload, so we must allow both shapes.
    Usage:
      properties:
        prompt_tokens:
          type: integer
          title: Prompt Tokens
        total_tokens:
          type: integer
          title: Total Tokens
      additionalProperties: true
      type: object
      required:
        - prompt_tokens
        - total_tokens
      title: Usage
      description: The usage information for the request.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    AuthBearer:
      type: http
      scheme: bearer

````