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

# Openai Embeddings



## OpenAPI

````yaml https://api.deepinfra.com/openapi.json post /v1/embeddings
openapi: 3.1.0
info:
  title: DeepInfra API
  description: >-
    The DeepInfra API provides serverless AI inference, custom model
    deployments, and GPU rentals.
  version: 1.0.0
servers:
  - url: https://api.deepinfra.com
security: []
tags:
  - name: Chat Completions
    description: OpenAI and Anthropic-compatible chat completion endpoints for LLMs.
  - name: Text Completions
    description: OpenAI-compatible text completion endpoints.
  - name: Embeddings
    description: Generate text embeddings for search and RAG.
  - name: Image Generation
    description: Generate, edit, and create variations of images.
  - name: Audio
    description: OpenAI-compatible speech synthesis, transcription, and translation.
  - name: Text to Speech
    description: ElevenLabs-compatible TTS endpoints and voice management.
  - name: Inference
    description: Native DeepInfra inference API for models and deployments.
  - name: Dedicated Models
    description: Deploy and manage private model instances with autoscaling.
  - name: GPU Rentals
    description: Rent dedicated GPU containers.
  - name: Models
    description: Browse, search, and manage AI models.
  - name: Files & Batches
    description: File uploads and batch processing.
  - name: LoRA Adapters
    description: Create, manage, and query LoRA adapter models.
  - name: Agents
    description: Manage agent-framework instances (OpenClaw and friends).
  - name: Sandboxes
    description: Create and manage isolated sandbox environments.
  - name: Account
    description: User profile, team management, and rate limits.
  - name: Authentication
    description: API tokens, SSH keys, scoped JWTs, and login flows.
  - name: Billing
    description: Payment methods, usage tracking, and billing.
  - name: Logs & Metrics
    description: Query inference logs, deployment logs, and usage metrics.
  - name: Utilities
    description: Feedback submission and CLI version.
paths:
  /v1/embeddings:
    post:
      tags:
        - Embeddings
      summary: Openai Embeddings
      operationId: openai_embeddings_v1_embeddings_post
      parameters:
        - name: x-deepinfra-source
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Deepinfra-Source
        - name: user-agent
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: User-Agent
        - name: xi-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Xi-Api-Key
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenAIEmbeddingsIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    OpenAIEmbeddingsIn:
      properties:
        service_tier:
          anyOf:
            - $ref: '#/components/schemas/ServiceTier'
            - type: 'null'
          description: >-
            The service tier used for processing the request. 'priority'
            processes the request with higher priority (premium rate); 'flex'
            processes it at lower priority for a discount, served only when
            spare capacity exists and may be retried/timed out under load. Both
            apply only to models that support the respective tier.
        model:
          type: string
          title: Model
          description: model name
          examples:
            - thenlper/gte-large
        input:
          anyOf:
            - type: string
            - items:
                anyOf:
                  - type: string
                  - items:
                      oneOf:
                        - $ref: '#/components/schemas/ChatCompletionContentPartText'
                        - $ref: '#/components/schemas/ChatCompletionContentPartImage'
                      discriminator:
                        propertyName: type
                        mapping:
                          image_url:
                            $ref: >-
                              #/components/schemas/ChatCompletionContentPartImage
                          text:
                            $ref: '#/components/schemas/ChatCompletionContentPartText'
                    type: array
              type: array
          maxLength: 1024
          title: Input
          description: >-
            text or multimodal content to embed. Each item is either a string,
            or a list of content parts ({"type":"text"} / {"type":"image_url"})
            for multimodal embedding models such as
            nvidia/llama-nemotron-embed-vl-1b-v2.
          examples:
            - - I like chocolate
          soft_required: true
        input_type:
          anyOf:
            - type: string
              enum:
                - query
                - passage
                - document
            - type: 'null'
          title: Input Type
          description: >-
            Role hint for asymmetric retrieval models: 'query' embeds a search
            query, 'passage'/'document' embeds a document. Controls the
            query:/passage: prefix on VL embedding models; ignored by symmetric
            models.
        encoding_format:
          type: string
          enum:
            - float
            - base64
          title: Encoding Format
          description: format used when encoding
          default: float
        dimensions:
          anyOf:
            - type: integer
              minimum: 32
            - type: 'null'
          title: Dimensions
          description: >-
            The number of dimensions in the embedding. If not provided, the
            model's default will be used.If provided bigger than model's
            default, the embedding will be padded with zeros.
          examples:
            - 1536
            - 1024
            - 768
            - 512
            - 256
            - 128
            - 64
      type: object
      required:
        - model
        - input
      title: OpenAIEmbeddingsIn
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ServiceTier:
      type: string
      enum:
        - default
        - priority
        - flex
      title: ServiceTier
    ChatCompletionContentPartText:
      properties:
        type:
          type: string
          const: text
          title: Type
        text:
          type: string
          title: Text
      type: object
      required:
        - type
        - text
      title: ChatCompletionContentPartText
    ChatCompletionContentPartImage:
      properties:
        type:
          type: string
          const: image_url
          title: Type
        image_url:
          $ref: '#/components/schemas/ImageURL'
      type: object
      required:
        - type
        - image_url
      title: ChatCompletionContentPartImage
    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
    ImageURL:
      properties:
        url:
          type: string
          title: Url
        detail:
          type: string
          enum:
            - auto
            - low
            - high
          title: Detail
          default: auto
      type: object
      required:
        - url
      title: ImageURL
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````