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

# Create embeddings (legacy engines)

> Legacy engine-based embeddings path format for older SDK integrations.



## OpenAPI

````yaml api-reference/openapi.json POST /v1/engines/{engine}/embeddings
openapi: 3.1.0
info:
  title: DGrid AI Gateway API
  description: >-
    A single, unified API to access 200+ leading AI models. OpenAI-, Claude-,
    and Gemini-compatible endpoints for chat, completions, embeddings, images,
    audio, and moderations.
  version: 1.0.0
  contact:
    name: DGrid AI
    url: https://dgrid.ai
servers:
  - url: https://api.dgrid.ai
    description: DGrid AI Gateway
security:
  - bearerAuth: []
paths:
  /v1/engines/{engine}/embeddings:
    post:
      tags:
        - Embeddings
      summary: Create embeddings (legacy engines)
      description: Legacy engine-based embeddings path format for older SDK integrations.
      operationId: createEngineEmbedding
      parameters:
        - name: engine
          in: path
          required: true
          schema:
            type: string
          description: Engine identifier used in the request path.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              properties:
                model:
                  type: string
                  description: Embedding model ID used in the JSON body.
                input:
                  type: string
                  description: Input text to embed.
            example:
              model: text-embedding-ada-002
              input: The quick brown fox
      responses:
        '200':
          $ref: '#/components/responses/EmbeddingList'
        '400':
          $ref: '#/components/responses/BadRequest'
components:
  responses:
    EmbeddingList:
      description: Embedding results.
      content:
        application/json:
          schema:
            type: object
            properties:
              object:
                type: string
                description: Always `list`.
              data:
                type: array
                description: Embedding results.
                items:
                  type: object
                  properties:
                    object:
                      type: string
                      description: Always `embedding`.
                    embedding:
                      type: array
                      items:
                        type: number
                      description: Embedding vector.
                    index:
                      type: integer
                      description: Embedding index.
              model:
                type: string
                description: Model used for the request.
              usage:
                type: object
                properties:
                  prompt_tokens:
                    type: integer
                  total_tokens:
                    type: integer
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your DGrid API key. All endpoints use `Authorization: Bearer
        <DGRID_API_KEY>`.

````