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

# Embeddings (Beta)

> How to reason about embedding models and how the Gateway surfaces them.



## OpenAPI

````yaml POST /embeddings
openapi: 3.0.3
info:
  title: AI Stats Gateway API
  description: >-
    A gateway API for accessing various AI models with OpenAI-compatible
    endpoints.
  version: 1.0.0
  contact:
    name: AI Stats
    url: https://docs.ai-stats.phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core AI Stats Gateway operations.
paths:
  /embeddings:
    post:
      tags:
        - Gateway
      summary: Create embeddings
      description: Creates an embedding vector representing the input text.
      operationId: createEmbedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingsRequest'
      responses:
        '200':
          description: Embeddings response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingsResponse'
components:
  schemas:
    EmbeddingsRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: integer
            - $ref: '#/components/schemas/EmbeddingsMultimodalInput'
            - type: array
              items:
                oneOf:
                  - type: string
                  - type: array
                    items:
                      type: integer
                  - $ref: '#/components/schemas/EmbeddingsMultimodalInput'
        encoding_format:
          type: string
          enum:
            - float
            - base64
        dimensions:
          type: integer
          minimum: 1
        provider_options:
          type: object
          properties:
            google:
              type: object
              properties:
                task_type:
                  type: string
                  pattern: ^[A-Z_]+$
                title:
                  type: string
            mistral:
              type: object
              properties:
                output_dtype:
                  type: string
                  enum:
                    - float
                    - int8
                    - uint8
                    - binary
                    - ubinary
        user:
          type: string
        debug:
          $ref: '#/components/schemas/DebugOptions'
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
    EmbeddingsResponse:
      type: object
      properties:
        object:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Embedding'
        model:
          type: string
        usage:
          $ref: '#/components/schemas/Usage'
    EmbeddingsMultimodalInput:
      type: object
      description: Google multimodal embeddings extension item.
      required:
        - content
      properties:
        content:
          type: array
          minItems: 1
          items:
            oneOf:
              - type: object
                required:
                  - type
                  - text
                properties:
                  type:
                    type: string
                    enum:
                      - text
                      - input_text
                  text:
                    type: string
              - type: object
                required:
                  - type
                properties:
                  type:
                    type: string
                    enum:
                      - image_url
                      - input_image
                      - image
                  image_url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                  url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                anyOf:
                  - required:
                      - image_url
                  - required:
                      - url
              - type: object
                required:
                  - type
                  - input_audio
                properties:
                  type:
                    type: string
                    enum:
                      - input_audio
                  input_audio:
                    type: object
                    properties:
                      data:
                        type: string
                      url:
                        type: string
                      format:
                        type: string
                    anyOf:
                      - required:
                          - data
                      - required:
                          - url
              - type: object
                required:
                  - type
                properties:
                  type:
                    type: string
                    enum:
                      - input_video
                      - video_url
                  video_url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                  url:
                    oneOf:
                      - type: string
                      - type: object
                        required:
                          - url
                        properties:
                          url:
                            type: string
                anyOf:
                  - required:
                      - video_url
                  - required:
                      - url
    DebugOptions:
      type: object
      description: Gateway debug controls. These flags are never forwarded upstream.
      properties:
        enabled:
          type: boolean
        return_upstream_request:
          type: boolean
        return_upstream_response:
          type: boolean
        trace:
          type: boolean
        trace_level:
          type: string
          enum:
            - summary
            - full
    ProviderRoutingOptions:
      type: object
      description: Provider routing preferences for gateway selection.
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: Include alpha providers in routing (off by default).
    Embedding:
      type: object
      properties:
        object:
          type: string
        embedding:
          type: array
          items:
            type: number
        index:
          type: integer
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
        server_tool_use:
          $ref: '#/components/schemas/ServerToolUsage'
    ServerToolUsage:
      type: object
      properties:
        datetime_requests:
          type: integer
          minimum: 0
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

````